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