Commit Graph

201 Commits

Author SHA1 Message Date
Paul Holden
0e742a2fc9 MDL-69643 message: final removal of deprecated 310 methods. 2023-01-06 09:28:40 +00:00
Neill Magill
8029023ed5 MDL-66955 messages: Improve speed of message search
The OR conditions in the WHERE clause prevented the query from
effectively filtering the messages related to the user quickly, this
change helps gets around this by allowing the database to limit
the rows in the messages table it needs to scan significantly.
2022-09-30 08:29:08 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Neill Magill
6fb4a3b56e MDL-72948 messaging: Minimise fields used in query
Most of the fields in the query are not needed and are discarded
soon after visibility checks are made.
2022-06-22 10:11:18 +01:00
Neill Magill
a8d9b17b4b MDL-63983 messaging: Improve the performance of non-contact searches
When the messagingallusers setting is disabled only contacts that are
on the same course as the user should be returned as results.

We can reduce the number of candidate users significantly by
pre-filtering them by being enrolled on the same courses as the user
performing the search.

Since we must also return the user themselves sometimes, even when they
are not enrolled on a course I used a UNION as the most efficient way of
retriving them, this meant that the order by had to reference returned
columns by number to be sufficiently cross-database compatiable.
2021-10-28 10:56:38 +01:00
Andrew Nicols
d5e04cab9a MDL-66266 core_message: Whitespace fix 2021-08-19 09:10:18 +02:00
cescobedo
4631be32eb MDL-66266 core_message: Final deprecation of 3.8 api functions
Final deprecation of:
- can_post_message
- get_individual_conversations_between_users
2021-07-22 06:31:05 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Ferran Recio
ce87be7db6 MDL-67782 message: fix messages max length 2021-01-12 17:14:33 +01:00
David Matamoros
c99a148628 MDL-69411 core_message: Fix return structure for empty result set
Passing a timefrom higher than last message timecreated needs to
return a formatted response so it does not break ws.
2020-11-23 19:25:09 +01:00
Simon Mok
bf17107882 MDL-68070 messaging: Fix error when personal notification is disabled 2020-10-12 19:30:02 +08:00
Mathew May
ee94aded30 MDL-63261 messaging: Final 3.6 deprecations 2020-09-07 09:10:46 +08:00
Paul Holden
809be05428 MDL-65819 message: send contact requests using recipient language. 2020-07-15 20:24:44 +01:00
Paul Holden
9965b654f8 MDL-65796 message: improve content of contact request notifications. 2020-05-13 15:40:17 +01:00
Paul Holden
df2544ee7b MDL-56389 message: allow marking notifications as read up to given time. 2020-01-23 22:16:30 +00:00
Amaia Anabitarte
23033ff48b MDL-63650 core_message: Final deprecation of mark_all_read_for_user 2019-12-20 11:52:45 +01:00
Juan Leyva
dcadc8c54c MDL-65968 notifications: Use f1 size avatars for Push notifications 2019-09-17 16:29:02 +02:00
Juan Leyva
47138d9157 MDL-66244 message: Include group sender images in payload
Android 9 notifications now displays two image icons in conversations.
The group and the sender.
2019-08-28 10:33:59 +01:00
Mark Nelson
90403c5d9d MDL-65093 core_message: users can't block any user they want
If blocking will have no effect (ie. you are attempting to block
the admin) the 'Block' button will not be shown and instead a
message will be shown explaining why you can not block the user.
2019-07-29 10:39:57 +08:00
Mark Nelson
06d046c1ff MDL-65093 core_message: deprecate can_post_message() 2019-07-29 10:39:57 +08:00
Eloy Lafuente (stronk7)
e867ffd689 Merge branch 'MDL-65344_master' of git://github.com/markn86/moodle 2019-06-05 21:06:15 +02:00
Jake Dallimore
7918a0ea4c MDL-65566 core_message: let get_self_conversation use lazy init too 2019-05-15 18:46:41 +08:00
Jake Dallimore
510ede5698 MDL-65566 core_message: fix bug allowing duplicate unique conversations
Individual and self conversations may exist once only, so we need to
enforce this in the creation method.
2019-05-15 18:46:39 +08:00
Sara Arjona
18e5f9bef8 MDL-65566 core_message: create the self-conversation when needed
Instead of creating all the self-conversations during the upgrading,
some code has been added to the get_conversations and to the
get_conversation_counts to create it whe it doesn't exist.
2019-05-15 18:42:46 +08:00
Jake Dallimore
a0523b826e MDL-65313 core_favourites: component scoped deletion now requires itemid
This now requires itemid, which cannot be null. This is safer. The
context can still be passed in as an optional parameter.
2019-05-07 16:26:46 +08:00
Andrew Nicols
2daa199351 Merge branch 'MDL-65132-master' of git://github.com/cescobedo/moodle 2019-05-07 16:24:40 +08:00
cescobedo
d47e067184 MDL-65132 core_message: Added API to delete message for all users 2019-05-06 09:38:54 +02:00
Jake Dallimore
6421775ad2 MDL-65313 core_message: remove favourites when deleting a conversation
When deleting a conversation for all users (e.g. when deleting a group
which has a conversation), we need to remove any favourites.
2019-05-06 14:01:34 +08:00
Jake Dallimore
3edac09063 MDL-65169 core_message: user search respects profile visibility
Two modes of visibility checking are supported, depending on the value
of the 'messagingallusers' site setting (site-wide messaging):
- If site-wide messaging is enabled, a user may only be returned in
search results if the searching user can view their profile somewhere
(either the site profile or any course profile).
- If site-wide messaging is disabled, a user may only be returned in
search results if the searching user shares a course with them and can
view their course profile in the shared course.
2019-04-30 11:25:46 +08:00
Mark Nelson
57532ad680 MDL-65344 core_message: deprecate get_individual_conversations_between_users() 2019-04-30 10:35:55 +08:00
David Monllaó
b63c0b9079 Merge branch 'MDL-60680-master' of git://github.com/jleyva/moodle 2019-04-25 18:55:45 +02:00
Juan Leyva
2356454f21 MDL-60680 notifications: Include action buttons information 2019-04-25 14:55:57 +02:00
Juan Leyva
36fa0ec900 MDL-60680 notifications: Return custom data in notifications 2019-04-25 14:55:18 +02:00
Sara Arjona
734b198fd3 MDL-64715 message: add support for self conversations
Added new MESSAGE_CONVERSATION_TYPE_SELF type for self-conversations
and upgraded legacy self-conversations to the new type, removing
repeated members in the message_conversation_members table.
Besides, from now, a self-conversation will be created by default for
all the existing users.

All the self-conversations have been also starred and a default message
will be displayed always to explain how to use them.
2019-04-15 20:17:54 +02:00
Sara Arjona
2767426111 MDL-64715 message: avoid duplicate entries when searching messages 2019-04-15 14:29:10 +02:00
cescobedo
3a5afbf5f1 MDL-65015 core_message: add trusttext cleaning to messaging 2019-04-07 10:56:53 +02:00
Mark Nelson
978f233b8b MDL-64568 core_message: added new method to nuke conversations entirely
This method removes all data in the database related to a
given conversation.
2019-03-13 15:41:53 +08:00
Mark Nelson
00c5924546 MDL-64773 core_message: ensure existing APIs return muted status 2019-03-13 08:55:13 +08:00
Mark Nelson
2687312b29 MDL-64773 core_message: added API to mute/unmute conversations 2019-03-13 08:55:13 +08:00
Andrew Nicols
3d122bd284 Merge branch 'MDL-63915_master' of git://github.com/markn86/moodle 2019-02-27 12:08:09 +08:00
Mark Nelson
7ece4ca9da MDL-63915 core_message: mark items that can be removed in MDL-63261 2019-02-27 11:35:36 +08:00
Mark Nelson
89bab5e8f0 MDL-64931 core_message: fixed PHP error when users are deleted from DB 2019-02-25 07:48:44 +08:00
Eloy Lafuente (stronk7)
bfaebeb754 Merge branch 'MDL-64791-master' of git://github.com/jleyva/moodle 2019-02-19 17:42:21 +01:00
Juan Leyva
289b79992b MDL-64791 messages: Bring back 'messagecontactrequests' message 2019-02-07 12:06:41 +01:00
Mark Nelson
fc2664501b MDL-64632 core_message: fixed PHP error when users are deleted from DB 2019-02-04 12:36:22 +08:00
Eloy Lafuente (stronk7)
f7ff96c24f Merge branch 'MDL-64412-master' of https://github.com/snake/moodle 2019-01-22 23:46:45 +01:00
Eloy Lafuente (stronk7)
c7f9834e29 MDL-64426 core_message: fix context::instance_by_id() wrong use 2019-01-08 23:01:52 +01:00
Jake Dallimore
e66e867f6e MDL-64426 core_message: fix filter support in api::get_conversations()
Conversation name and subname should support filters, so the data should
be passed through format_string, and advertised in the external params
as PARAM_TEXT.
2019-01-08 15:50:43 +08:00
Jake Dallimore
a3a6e3c905 MDL-64412 core_message: remove ordering code from message_search_users()
This code is no longer needed as get_member_info() now respects the
ordering of the $userids param.
2019-01-02 15:21:07 +08:00