1 |
efrain |
1 |
This files describes API changes in /message/ messaging system,
|
|
|
2 |
information provided here is intended especially for developers.
|
|
|
3 |
|
|
|
4 |
=== 4.2 ===
|
|
|
5 |
|
|
|
6 |
* The following methods, deprecated since 3.10, have been removed and can no longer be used:
|
|
|
7 |
- `message_count_unread_messages`
|
|
|
8 |
- `\core_message\api::get_non_contacts_with_unread_message_count`
|
|
|
9 |
- `\core_message\api::get_contacts_with_unread_message_count`
|
|
|
10 |
|
|
|
11 |
=== 4.0 ===
|
|
|
12 |
|
|
|
13 |
The following functions have been finally deprecated and can not be used anymore:
|
|
|
14 |
* can_post_message()
|
|
|
15 |
* get_individual_conversations_between_users()
|
|
|
16 |
* The message_jabber notification has been completely removed from core. It has been moved to the plugins database repository, so
|
|
|
17 |
it can still be installed as a third-party plugin.
|
|
|
18 |
* The type of the parameter $read in the function message_get_messages has changed from boolean to integer. It now accepts either MESSAGE_GET_UNREAD, MESSAGE_GET_READ or MESSAGE_GET_READ_AND_UNREAD.
|
|
|
19 |
|
|
|
20 |
=== 3.11.2 ===
|
|
|
21 |
|
|
|
22 |
* The `message_page_type_list` method was previouly deprecated, however it was still
|
|
|
23 |
used so has been recreated in message/lib.php
|
|
|
24 |
|
|
|
25 |
=== 3.10 ===
|
|
|
26 |
|
|
|
27 |
* The following methods have been deprecated and should not be used any more:
|
|
|
28 |
* message_count_unread_messages()
|
|
|
29 |
* get_non_contacts_with_unread_message_count()
|
|
|
30 |
* get_contacts_with_unread_message_count()
|
|
|
31 |
|
|
|
32 |
* The following functions have been finally deprecated and can not be used anymore::
|
|
|
33 |
* search_users_in_course()
|
|
|
34 |
* search_users()
|
|
|
35 |
* get_contacts()
|
|
|
36 |
* get_messages()
|
|
|
37 |
* get_most_recent_message()
|
|
|
38 |
* get_profile()
|
|
|
39 |
* get_messages()
|
|
|
40 |
* create_messages()
|
|
|
41 |
* get_conversations_legacy_formatter()
|
|
|
42 |
* create_contacts()
|
|
|
43 |
* block_contacts()
|
|
|
44 |
* unblock_contacts()
|
|
|
45 |
* data_for_messagearea_search_users_in_course()
|
|
|
46 |
* data_for_messagearea_search_users()
|
|
|
47 |
* message_search_users()
|
|
|
48 |
* data_for_messagearea_conversations()
|
|
|
49 |
* data_for_messagearea_contacts()
|
|
|
50 |
* data_for_messagearea_messages()
|
|
|
51 |
* get_conversation_messages()
|
|
|
52 |
* data_for_messagearea_get_most_recent_message()
|
|
|
53 |
* data_for_messagearea_get_profile()
|
|
|
54 |
* mark_all_messages_as_read()
|
|
|
55 |
* delete_conversation()
|
|
|
56 |
|
|
|
57 |
=== 3.9 ===
|
|
|
58 |
* Removed the following deprecated functions:
|
|
|
59 |
- message_move_userfrom_unread2read
|
|
|
60 |
- message_get_blocked_users
|
|
|
61 |
- message_get_contacts
|
|
|
62 |
- message_mark_message_read
|
|
|
63 |
- message_can_delete_message
|
|
|
64 |
- message_delete_message
|
|
|
65 |
- mark_all_read_for_user()
|
|
|
66 |
* Message processors can implement the following methods which will be executed as part of the messaging cleanup task:
|
|
|
67 |
- cleanup_all_notifications
|
|
|
68 |
- cleanup_read_notifications
|
|
|
69 |
|
|
|
70 |
=== 3.8 ===
|
|
|
71 |
|
|
|
72 |
* The following methods have been deprecated and should not be used any more:
|
|
|
73 |
- \core_message\api::get_individual_conversations_between_users()
|
|
|
74 |
- \core_message\api::can_post_message()
|
|
|
75 |
|
|
|
76 |
=== 3.7 ===
|
|
|
77 |
|
|
|
78 |
* The message/index.php page used to support viewing another user's messages (if you had the right capabilities) by
|
|
|
79 |
altering the URL and adding the parameters 'user1' and 'user2'. There were only some very rare occurrences where you
|
|
|
80 |
could access a URL generated with these parameters (eg. log report). It was decided to stop supporting this
|
|
|
81 |
functionality and remove all the legacy code (see MDL-63915).
|
|
|
82 |
Note - It's still possible to view another user's messages if you have the right capabilities and are able to
|
|
|
83 |
'log-in as' them.
|
|
|
84 |
* A new parameter 'mergeself' has been added to the methods \core_message\api::get_conversations() and
|
|
|
85 |
core_message_external::get_conversations(), to decide whether the self-conversations should be included or not when the
|
|
|
86 |
private ones are requested, to display them together.
|
|
|
87 |
* A new 'customdata' field for both messages and notifications has been added. This new field can store any custom data
|
|
|
88 |
serialised using json_encode().
|
|
|
89 |
This new field can be used for storing any data not fitting in the current message structure. For example, it will be used
|
|
|
90 |
to store additional information for the "Mobile notifications" processor.
|
|
|
91 |
Existing external functions: core_message_get_messages and message_popup_get_popup_notifications has been udated to return the
|
|
|
92 |
new field.
|
|
|
93 |
* External function core_message_get_messages now returns the component and eventtype.
|
|
|
94 |
|
|
|
95 |
=== 3.6 ===
|
|
|
96 |
|
|
|
97 |
* The following functions have been finally deprecated and can not be used anymore:
|
|
|
98 |
* message_get_course_contexts()
|
|
|
99 |
* message_remove_url_params()
|
|
|
100 |
* message_count_messages()
|
|
|
101 |
* message_count_blocked_users()
|
|
|
102 |
* message_contact_link()
|
|
|
103 |
* message_history_link()
|
|
|
104 |
* message_shorten_message()
|
|
|
105 |
* message_get_fragment()
|
|
|
106 |
* message_get_contact_add_remove_link()
|
|
|
107 |
* message_get_contact_block_link()
|
|
|
108 |
* message_mark_messages_read()
|
|
|
109 |
* message_page_type_list()
|
|
|
110 |
* message_can_post_message()
|
|
|
111 |
* message_is_user_non_contact_blocked()
|
|
|
112 |
* message_is_user_blocked()
|
|
|
113 |
* The following functions have been deprecated and should not be used any more:
|
|
|
114 |
- message_add_contact()
|
|
|
115 |
- message_remove_contact()
|
|
|
116 |
- message_unblock_contact()
|
|
|
117 |
- message_block_contact()
|
|
|
118 |
- message_get_contact()
|
|
|
119 |
Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
|
|
|
120 |
* The following methods have been deprecated and should not be used any more:
|
|
|
121 |
- \core_message\api::is_user_blocked()
|
|
|
122 |
- \core_message\api::delete_conversation()
|
|
|
123 |
- \core_message\api::is_user_non_contact_blocked()
|
|
|
124 |
- \core_message\api::create_conversation_between_users()
|
|
|
125 |
* The method \core_message\api::can_delete_conversation() now expects a 'conversationid' to be passed
|
|
|
126 |
as the second parameter.
|
|
|
127 |
* The following web services have been deprecated. Please do not call these any more.
|
|
|
128 |
- core_message_external::block_contacts(), please use core_message_external::block_user() instead.
|
|
|
129 |
- core_message_external::unblock_contacts(), please use core_message_external::unblock_user() instead.
|
|
|
130 |
- core_message_external::create_contacts(), please use core_message_external::create_contact_request() instead.
|
|
|
131 |
- core_message_external::delete_conversation(), please use core_message_external::delete_conversations_by_id() instead.
|
|
|
132 |
- core_message_external::core_message_mark_all_messages_as_read(), please use
|
|
|
133 |
core_message_external::core_message_mark_all_conversation_messages_as_read() instead.
|
|
|
134 |
- core_message_external::data_for_messagearea_conversations(), please use core_message_external::get_conversations()
|
|
|
135 |
instead
|
|
|
136 |
- core_message_external::data_for_messagearea_search_users_in_course().
|
|
|
137 |
- core_message_external::data_for_messagearea_search_users(),
|
|
|
138 |
please use core_message_external::message_search_users() instead.
|
|
|
139 |
- core_message_external::data_for_messagearea_contacts().
|
|
|
140 |
- core_message_external::data_for_messagearea_messages().
|
|
|
141 |
- core_message_external::data_for_messagearea_get_most_recent_message().
|
|
|
142 |
- core_message_external::data_for_messagearea_get_profile().
|
|
|
143 |
- core_message_external::get_contacts().
|
|
|
144 |
* The following function has been added for getting the privacy messaging preference:
|
|
|
145 |
- get_user_privacy_messaging_preference()
|
|
|
146 |
|
|
|
147 |
=== 3.5 ===
|
|
|
148 |
|
|
|
149 |
* Changed the database structure so there are no longer two tables for messages, with the only
|
|
|
150 |
difference being that one stores read messages. The 'message' and 'message_read' tables are
|
|
|
151 |
still present in core but will no longer be populated by core APIs. The data will be
|
|
|
152 |
transferred to the new database structure via an ad-hoc task. Please be patient. This can
|
|
|
153 |
take time.
|
|
|
154 |
The new database structure is as follows -
|
|
|
155 |
'messages' - Stores the messages with a 'useridfrom' field specifying the user who sent the
|
|
|
156 |
message and a 'conversationid' field specifying which conversation it is for.
|
|
|
157 |
'message_conversations' - The list of conversations.
|
|
|
158 |
'message_conversation_members' - The list of users in each conversation.
|
|
|
159 |
'message_user_actions' - The list of user actions against a message, eg. read/deleted.
|
|
|
160 |
'notifications' - This has a very similar structure to the old table 'message' and still
|
|
|
161 |
has a one-to-one relation between users.
|
|
|
162 |
Due to these huge differences the events message_sent, message_deleted and message_viewed
|
|
|
163 |
have changed quite a lot. Please, if you have any observers or are triggering these events
|
|
|
164 |
in your code you will have to make some changes!
|
|
|
165 |
* The webservice external function 'core_message_mark_message_read' now only marks messages as
|
|
|
166 |
read, and not notifications. A new external function 'core_message_mark_notification_read' was
|
|
|
167 |
added to mark notifications as read.
|
|
|
168 |
* Deprecated the following functions.
|
|
|
169 |
- message_move_userfrom_unread2read
|
|
|
170 |
- message_get_blocked_users
|
|
|
171 |
- message_get_contacts
|
|
|
172 |
- message_mark_message_read
|
|
|
173 |
- message_can_delete_message
|
|
|
174 |
- message_delete_message
|
|
|
175 |
- \core_message\api::mark_all_read_for_user
|
|
|
176 |
Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
|
|
|
177 |
* Final deprecation of the following functions.
|
|
|
178 |
- message_get_recent_notifications
|
|
|
179 |
- message_search
|
|
|
180 |
- message_get_history
|
|
|
181 |
- message_get_recent_conversations
|
|
|
182 |
* Added new events for when a notification is sent and viewed.
|
|
|
183 |
* Removed the database table 'message_working'. The 'message_working' table was introduced when
|
|
|
184 |
the messaging system was first introduced in Moodle, so, a long time ago. It was never necessary.
|
|
|
185 |
* Replaced the usage of the table 'message_popup' to a new table 'message_popup_notifications'.
|
|
|
186 |
|
|
|
187 |
=== 3.2 ===
|
|
|
188 |
|
|
|
189 |
* Removed all message_print_* functions as well as the files search.html, search_advanced.html and
|
|
|
190 |
send_form.php due to messaging UI rehaul.
|
|
|
191 |
* Deprecated the following functions as they are no longer used.
|
|
|
192 |
- message_get_course_contexts
|
|
|
193 |
- message_remove_url_params
|
|
|
194 |
- message_count_messages
|
|
|
195 |
- message_count_blocked_users
|
|
|
196 |
- message_contact_link
|
|
|
197 |
- message_get_recent_notifications
|
|
|
198 |
- message_history_link
|
|
|
199 |
- message_search
|
|
|
200 |
- message_shorten_message
|
|
|
201 |
- message_get_fragment
|
|
|
202 |
- message_get_history
|
|
|
203 |
- message_get_contact_add_remove_link
|
|
|
204 |
- message_get_contact_block_link
|
|
|
205 |
- message_mark_messages_read
|
|
|
206 |
- message_page_type_list
|
|
|
207 |
- message_can_post_message
|
|
|
208 |
- message_is_user_non_contact_blocked
|
|
|
209 |
- message_is_user_blocked
|
|
|
210 |
|
|
|
211 |
=== 3.1 ===
|
|
|
212 |
* get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
|
|
|
213 |
* Deprecated method message_current_user_is_involved() has been removed.
|
|
|
214 |
|
|
|
215 |
=== 2.9 ===
|
|
|
216 |
* Renderer method \core_message_renderer::manage_messagingoptions now accepts a user id parameter as well.
|
|
|
217 |
|
|
|
218 |
=== 2.6 ===
|
|
|
219 |
* Message processor extending message_output, should return true in can_send_to_any_users()
|
|
|
220 |
if it supports message sending to internal (noreply/support) users.
|
|
|
221 |
* Message API has been changed to allow attachments. Message processors that can support
|
|
|
222 |
attachments can now use additional parameter as a part of $eventdata. To send attachments,
|
|
|
223 |
$eventdata should contain properties called "attachment" (must be stored_file) and
|
|
|
224 |
"attachname" (string). Currently, email message processor is the only one to support
|
|
|
225 |
attachments.
|
|
|
226 |
|
|
|
227 |
=== 2.2 ===
|
|
|
228 |
|
|
|
229 |
required changes:
|
|
|
230 |
* lib/messagelib.php message_send($eventdata)
|
|
|
231 |
$eventdata->userto should contain a property called "emailstop", $eventdata->userto->emailstop
|
|
|
232 |
If it is absent it will be retrieved from the user table causing an additional database query
|