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