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