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