Merge branch 'MDL-71896-310' of git://github.com/merrill-oakland/moodle into MOODLE_3...
[moodle.git] / message / upgrade.txt
bloba989150feab189c8a73f58b62172bdf99ed0b7c7
1 This files describes API changes in /message/ messaging system,
2 information provided here is intended especially for developers.
4 === 3.10 ===
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()
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()
36 === 3.9 ===
37 * Removed the following deprecated functions:
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
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
49 === 3.8 ===
51 * The following methods have been deprecated and should not be used any more:
52   - \core_message\api::get_individual_conversations_between_users()
53   - \core_message\api::can_post_message()
55 === 3.7 ===
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.
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.
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.
74 === 3.6 ===
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()
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).
99 * The following methods have been deprecated and should not be used any more:
100   - \core_message\api::is_user_blocked()
101   - \core_message\api::delete_conversation()
102   - \core_message\api::is_user_non_contact_blocked()
103   - \core_message\api::create_conversation_between_users()
104 * The method \core_message\api::can_delete_conversation() now expects a 'conversationid' to be passed
105   as the second parameter.
106 * The following web services have been deprecated. Please do not call these any more.
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.
110   - core_message_external::delete_conversation(), please use core_message_external::delete_conversations_by_id() instead.
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.
113   - core_message_external::data_for_messagearea_conversations(), please use core_message_external::get_conversations()
114     instead
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.
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().
122   - core_message_external::get_contacts().
123 * The following function has been added for getting the privacy messaging preference:
124   - get_user_privacy_messaging_preference()
126 === 3.5 ===
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.
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'.
166 === 3.2 ===
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
190 === 3.1 ===
191 * get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
192 * Deprecated method message_current_user_is_involved() has been removed.
194 === 2.9 ===
195 * Renderer method \core_message_renderer::manage_messagingoptions now accepts a user id parameter as well.
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.
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.
206 === 2.2 ===
208 required 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