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