upgrade.txt 10.7 KB
Newer Older
1
2
3
This files describes API changes in /message/ messaging system,
information provided here is intended especially for developers.

4
5
6
7
8
=== 4.0 ===

The following functions have been finally deprecated and can not be used anymore:
  * can_post_message()
  * get_individual_conversations_between_users()
9
10
* The message_jabber notification has been completely removed from core. It has been moved to the plugins database repository, so
it can still be installed as a third-party plugin.
11
* 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.
12

13
14
15
16
17
=== 3.11.2 ===

* The `message_page_type_list` method was previouly deprecated, however it was still
  used so has been recreated in message/lib.php

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
=== 3.10 ===

* The following methods have been deprecated and should not be used any more:
  * message_count_unread_messages()
  * get_non_contacts_with_unread_message_count()
  * get_contacts_with_unread_message_count()

* The following functions have been finally deprecated and can not be used anymore::
  * search_users_in_course()
  * search_users()
  * get_contacts()
  * get_messages()
  * get_most_recent_message()
  * get_profile()
  * get_messages()
  * create_messages()
  * get_conversations_legacy_formatter()
  * create_contacts()
  * block_contacts()
  * unblock_contacts()
  * data_for_messagearea_search_users_in_course()
  * data_for_messagearea_search_users()
  * message_search_users()
  * data_for_messagearea_conversations()
  * data_for_messagearea_contacts()
  * data_for_messagearea_messages()
  * get_conversation_messages()
  * data_for_messagearea_get_most_recent_message()
  * data_for_messagearea_get_profile()
  * mark_all_messages_as_read()
  * delete_conversation()

50
=== 3.9 ===
51
* Removed the following deprecated functions:
52
53
54
55
56
57
  - message_move_userfrom_unread2read
  - message_get_blocked_users
  - message_get_contacts
  - message_mark_message_read
  - message_can_delete_message
  - message_delete_message
58
59
60
61
  - mark_all_read_for_user()
* Message processors can implement the following methods which will be executed as part of the messaging cleanup task:
  - cleanup_all_notifications
  - cleanup_read_notifications
62

63
64
65
66
=== 3.8 ===

* The following methods have been deprecated and should not be used any more:
  - \core_message\api::get_individual_conversations_between_users()
67
  - \core_message\api::can_post_message()
68

69
70
71
72
73
74
75
76
=== 3.7 ===

* The message/index.php page used to support viewing another user's messages (if you had the right capabilities) by
  altering the URL and adding the parameters 'user1' and 'user2'. There were only some very rare occurrences where you
  could access a URL generated with these parameters (eg. log report). It was decided to stop supporting this
  functionality and remove all the legacy code (see MDL-63915).
  Note - It's still possible to view another user's messages if you have the right capabilities and are able to
  'log-in as' them.
77
78
79
* A new parameter 'mergeself' has been added to the methods \core_message\api::get_conversations() and
  core_message_external::get_conversations(), to decide whether the self-conversations should be included or not when the
  private ones are requested, to display them together.
80
81
82
83
84
85
86
* A new 'customdata' field for both messages and notifications has been added. This new field can store any custom data
  serialised using json_encode().
  This new field can be used for storing any data not fitting in the current message structure. For example, it will be used
  to store additional information for the "Mobile notifications" processor.
  Existing external functions: core_message_get_messages and message_popup_get_popup_notifications has been udated to return the
  new field.
* External function core_message_get_messages now returns the component and eventtype.
87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
=== 3.6 ===

* The following functions have been finally deprecated and can not be used anymore:
  * message_get_course_contexts()
  * message_remove_url_params()
  * message_count_messages()
  * message_count_blocked_users()
  * message_contact_link()
  * message_history_link()
  * message_shorten_message()
  * message_get_fragment()
  * message_get_contact_add_remove_link()
  * message_get_contact_block_link()
  * message_mark_messages_read()
  * message_page_type_list()
  * message_can_post_message()
  * message_is_user_non_contact_blocked()
  * message_is_user_blocked()
106
107
108
109
110
111
112
* The following functions have been deprecated and should not be used any more:
  - message_add_contact()
  - message_remove_contact()
  - message_unblock_contact()
  - message_block_contact()
  - message_get_contact()
  Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
113
114
* The following methods have been deprecated and should not be used any more:
  - \core_message\api::is_user_blocked()
115
  - \core_message\api::delete_conversation()
116
  - \core_message\api::is_user_non_contact_blocked()
117
  - \core_message\api::create_conversation_between_users()
118
119
* The method \core_message\api::can_delete_conversation() now expects a 'conversationid' to be passed
  as the second parameter.
120
* The following web services have been deprecated. Please do not call these any more.
121
122
123
  - core_message_external::block_contacts(), please use core_message_external::block_user() instead.
  - core_message_external::unblock_contacts(), please use core_message_external::unblock_user() instead.
  - core_message_external::create_contacts(), please use core_message_external::create_contact_request() instead.
124
  - core_message_external::delete_conversation(), please use core_message_external::delete_conversations_by_id() instead.
125
126
  - core_message_external::core_message_mark_all_messages_as_read(), please use
    core_message_external::core_message_mark_all_conversation_messages_as_read() instead.
127
128
  - core_message_external::data_for_messagearea_conversations(), please use core_message_external::get_conversations()
    instead
129
130
131
  - core_message_external::data_for_messagearea_search_users_in_course().
  - core_message_external::data_for_messagearea_search_users(),
    please use core_message_external::message_search_users() instead.
132
133
134
135
  - core_message_external::data_for_messagearea_contacts().
  - core_message_external::data_for_messagearea_messages().
  - core_message_external::data_for_messagearea_get_most_recent_message().
  - core_message_external::data_for_messagearea_get_profile().
136
  - core_message_external::get_contacts().
137
138
* The following function has been added for getting the privacy messaging preference:
  - get_user_privacy_messaging_preference()
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
=== 3.5 ===

* Changed the database structure so there are no longer two tables for messages, with the only
  difference being that one stores read messages. The 'message' and 'message_read' tables are
  still present in core but will no longer be populated by core APIs. The data will be
  transferred to the new database structure via an ad-hoc task. Please be patient. This can
  take time.
  The new database structure is as follows -
  'messages' - Stores the messages with a 'useridfrom' field specifying the user who sent the
               message and a 'conversationid' field specifying which conversation it is for.
  'message_conversations' - The list of conversations.
  'message_conversation_members' - The list of users in each conversation.
  'message_user_actions' - The list of user actions against a message, eg. read/deleted.
  'notifications' - This has a very similar structure to the old table 'message' and still
                    has a one-to-one relation between users.
  Due to these huge differences the events message_sent, message_deleted and message_viewed
  have changed quite a lot. Please, if you have any observers or are triggering these events
  in your code you will have to make some changes!
* The webservice external function 'core_message_mark_message_read' now only marks messages as
  read, and not notifications. A new external function 'core_message_mark_notification_read' was
  added to mark notifications as read.
* Deprecated the following functions.
  - message_move_userfrom_unread2read
  - message_get_blocked_users
  - message_get_contacts
  - message_mark_message_read
  - message_can_delete_message
  - message_delete_message
  - \core_message\api::mark_all_read_for_user
  Please see their declaration in lib/deprecatedlib.php to view their alternatives (if applicable).
* Final deprecation of the following functions.
  - message_get_recent_notifications
  - message_search
  - message_get_history
  - message_get_recent_conversations
* Added new events for when a notification is sent and viewed.
176
177
178
* Removed the database table 'message_working'. The 'message_working' table was introduced when
  the messaging system was first introduced in Moodle, so, a long time ago. It was never necessary.
* Replaced the usage of the table 'message_popup' to a new table 'message_popup_notifications'.
179

180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
=== 3.2 ===

* Removed all message_print_* functions as well as the files search.html, search_advanced.html and
  send_form.php due to messaging UI rehaul.
* Deprecated the following functions as they are no longer used.
    - message_get_course_contexts
    - message_remove_url_params
    - message_count_messages
    - message_count_blocked_users
    - message_contact_link
    - message_get_recent_notifications
    - message_history_link
    - message_search
    - message_shorten_message
    - message_get_fragment
    - message_get_history
    - message_get_contact_add_remove_link
    - message_get_contact_block_link
    - message_mark_messages_read
    - message_page_type_list
    - message_can_post_message
    - message_is_user_non_contact_blocked
    - message_is_user_blocked

204
205
=== 3.1 ===
* get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
206
* Deprecated method message_current_user_is_involved() has been removed.
207

208
209
210
=== 2.9 ===
* Renderer method \core_message_renderer::manage_messagingoptions now accepts a user id parameter as well.

211
212
213
=== 2.6 ===
* Message processor extending message_output, should return true in can_send_to_any_users()
  if it supports message sending to internal (noreply/support) users.
214
215
216
217
218
* Message API has been changed to allow attachments. Message processors that can support
  attachments can now use additional parameter as a part of $eventdata. To send attachments,
  $eventdata should contain properties called "attachment" (must be stored_file) and
  "attachname" (string). Currently, email message processor is the only one to support
  attachments.
219

220
221
222
223
224
225
=== 2.2 ===

required changes:
* lib/messagelib.php message_send($eventdata)
  $eventdata->userto should contain a property called "emailstop", $eventdata->userto->emailstop
  If it is absent it will be retrieved from the user table causing an additional database query