Merge branch 'MDL-65876-master' of https://github.com/lucaboesch/moodle
[moodle.git] / message / upgrade.txt
blob078b06411105752cfeed0157752b256abb852e43
1 This files describes API changes in /message/ messaging system,
2 information provided here is intended especially for developers.
4 === 3.8 ===
6 * The following methods have been deprecated and should not be used any more:
7   - \core_message\api::get_individual_conversations_between_users()
8   - \core_message\api::can_post_message()
10 === 3.7 ===
12 * The message/index.php page used to support viewing another user's messages (if you had the right capabilities) by
13   altering the URL and adding the parameters 'user1' and 'user2'. There were only some very rare occurrences where you
14   could access a URL generated with these parameters (eg. log report). It was decided to stop supporting this
15   functionality and remove all the legacy code (see MDL-63915).
16   Note - It's still possible to view another user's messages if you have the right capabilities and are able to
17   'log-in as' them.
18 * A new parameter 'mergeself' has been added to the methods \core_message\api::get_conversations() and
19   core_message_external::get_conversations(), to decide whether the self-conversations should be included or not when the
20   private ones are requested, to display them together.
21 * A new 'customdata' field for both messages and notifications has been added. This new field can store any custom data
22   serialised using json_encode().
23   This new field can be used for storing any data not fitting in the current message structure. For example, it will be used
24   to store additional information for the "Mobile notifications" processor.
25   Existing external functions: core_message_get_messages and message_popup_get_popup_notifications has been udated to return the
26   new field.
27 * External function core_message_get_messages now returns the component and eventtype.
29 === 3.6 ===
31 * The following functions have been finally deprecated and can not be used anymore:
32   * message_get_course_contexts()
33   * message_remove_url_params()
34   * message_count_messages()
35   * message_count_blocked_users()
36   * message_contact_link()
37   * message_history_link()
38   * message_shorten_message()
39   * message_get_fragment()
40   * message_get_contact_add_remove_link()
41   * message_get_contact_block_link()
42   * message_mark_messages_read()
43   * message_page_type_list()
44   * message_can_post_message()
45   * message_is_user_non_contact_blocked()
46   * message_is_user_blocked()
47 * The following functions have been deprecated and should not be used any more:
48   - message_add_contact()
49   - message_remove_contact()
50   - message_unblock_contact()
51   - message_block_contact()
52   - message_get_contact()
53   Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
54 * The following methods have been deprecated and should not be used any more:
55   - \core_message\api::is_user_blocked()
56   - \core_message\api::delete_conversation()
57   - \core_message\api::is_user_non_contact_blocked()
58   - \core_message\api::create_conversation_between_users()
59 * The method \core_message\api::can_delete_conversation() now expects a 'conversationid' to be passed
60   as the second parameter.
61 * The following web services have been deprecated. Please do not call these any more.
62   - core_message_external::block_contacts(), please use core_message_external::block_user() instead.
63   - core_message_external::unblock_contacts(), please use core_message_external::unblock_user() instead.
64   - core_message_external::create_contacts(), please use core_message_external::create_contact_request() instead.
65   - core_message_external::delete_conversation(), please use core_message_external::delete_conversations_by_id() instead.
66   - core_message_external::core_message_mark_all_messages_as_read(), please use
67     core_message_external::core_message_mark_all_conversation_messages_as_read() instead.
68   - core_message_external::data_for_messagearea_conversations(), please use core_message_external::get_conversations()
69     instead
70   - core_message_external::data_for_messagearea_search_users_in_course().
71   - core_message_external::data_for_messagearea_search_users(),
72     please use core_message_external::message_search_users() instead.
73   - core_message_external::data_for_messagearea_contacts().
74   - core_message_external::data_for_messagearea_messages().
75   - core_message_external::data_for_messagearea_get_most_recent_message().
76   - core_message_external::data_for_messagearea_get_profile().
77   - core_message_external::get_contacts().
78 * The following function has been added for getting the privacy messaging preference:
79   - get_user_privacy_messaging_preference()
81 === 3.5 ===
83 * Changed the database structure so there are no longer two tables for messages, with the only
84   difference being that one stores read messages. The 'message' and 'message_read' tables are
85   still present in core but will no longer be populated by core APIs. The data will be
86   transferred to the new database structure via an ad-hoc task. Please be patient. This can
87   take time.
88   The new database structure is as follows -
89   'messages' - Stores the messages with a 'useridfrom' field specifying the user who sent the
90                message and a 'conversationid' field specifying which conversation it is for.
91   'message_conversations' - The list of conversations.
92   'message_conversation_members' - The list of users in each conversation.
93   'message_user_actions' - The list of user actions against a message, eg. read/deleted.
94   'notifications' - This has a very similar structure to the old table 'message' and still
95                     has a one-to-one relation between users.
96   Due to these huge differences the events message_sent, message_deleted and message_viewed
97   have changed quite a lot. Please, if you have any observers or are triggering these events
98   in your code you will have to make some changes!
99 * The webservice external function 'core_message_mark_message_read' now only marks messages as
100   read, and not notifications. A new external function 'core_message_mark_notification_read' was
101   added to mark notifications as read.
102 * Deprecated the following functions.
103   - message_move_userfrom_unread2read
104   - message_get_blocked_users
105   - message_get_contacts
106   - message_mark_message_read
107   - message_can_delete_message
108   - message_delete_message
109   - \core_message\api::mark_all_read_for_user
110   Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
111 * Final deprecation of the following functions.
112   - message_get_recent_notifications
113   - message_search
114   - message_get_history
115   - message_get_recent_conversations
116 * Added new events for when a notification is sent and viewed.
117 * Removed the database table 'message_working'. The 'message_working' table was introduced when
118   the messaging system was first introduced in Moodle, so, a long time ago. It was never necessary.
119 * Replaced the usage of the table 'message_popup' to a new table 'message_popup_notifications'.
121 === 3.2 ===
123 * Removed all message_print_* functions as well as the files search.html, search_advanced.html and
124   send_form.php due to messaging UI rehaul.
125 * Deprecated the following functions as they are no longer used.
126     - message_get_course_contexts
127     - message_remove_url_params
128     - message_count_messages
129     - message_count_blocked_users
130     - message_contact_link
131     - message_get_recent_notifications
132     - message_history_link
133     - message_search
134     - message_shorten_message
135     - message_get_fragment
136     - message_get_history
137     - message_get_contact_add_remove_link
138     - message_get_contact_block_link
139     - message_mark_messages_read
140     - message_page_type_list
141     - message_can_post_message
142     - message_is_user_non_contact_blocked
143     - message_is_user_blocked
145 === 3.1 ===
146 * get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
147 * Deprecated method message_current_user_is_involved() has been removed.
149 === 2.9 ===
150 * Renderer method \core_message_renderer::manage_messagingoptions now accepts a user id parameter as well.
152 === 2.6 ===
153 * Message processor extending message_output, should return true in can_send_to_any_users()
154   if it supports message sending to internal (noreply/support) users.
155 * Message API has been changed to allow attachments. Message processors that can support
156   attachments can now use additional parameter as a part of $eventdata. To send attachments,
157   $eventdata should contain properties called "attachment" (must be stored_file) and
158   "attachname" (string). Currently, email message processor is the only one to support
159   attachments.
161 === 2.2 ===
163 required changes:
164 * lib/messagelib.php message_send($eventdata)
165   $eventdata->userto should contain a property called "emailstop", $eventdata->userto->emailstop
166   If it is absent it will be retrieved from the user table causing an additional database query