This files describes API changes in /message/ messaging system,
information provided here is intended especially for developers.

=== 19.0 ===

* Updated notification row heading from h4 to h3 in notification_preferences_component.mustache
* Updated templates/notification_preferences.mustache to use a h1

=== 18.0 ===

* To mitigate the risk of denial of service, changes have been made to the external function
  'core_message_data_for_messagearea_search_users' regarding the validation of the 'limitnum' parameter:
  - The maximum possible value for the parameter is set to a default of 20, but can be overridden by setting a different
    value in config.php for $CFG->message_area_search_max_limitnum. Please make use of this if you need to call this
    external function with a 'limitnum' parameter greater than 20.
  - A value of integer zero (the default when the parameter was omitted) will not return unlimited results anymore. It
    will return up to the configured maximum amount.
  - Null value, negative values and values above the configured maximum amount will lead to an error.
* The core_message::mark_notification_read function is no longer interrupted by user-to-user messaging settings
  to allow it to work for the notifications sent via the 'site notification' delivery method.

=== 14.0 ===

* 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.
* Replaced the usage of the table 'message_popup' to a new table 'message_popup_notifications'.

=== 13.0 ===

* Adding table scope attributes to improve accessibility in:
** core_message/notification_preferences_component
** core_message/notification_preferences_component_notification
** core_message/notification_preferences_processor
* message_airnotifier plugin has been fully removed

=== 12.0 ===

* String helpers are no longer used in the following templates, string data is passed via context data:
** message/templates/message_area_context.mustache
** message/templates/message_area_messages_area.mustache
** message/templates/message_area_profile.mustache

=== 10.0 ===

* get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
* Deprecated method message_current_user_is_involved() has been removed.
* 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_can_post_message
    - message_is_user_non_contact_blocked
    - message_is_user_blocked
* message_count_unread_messages does not return notifications anymore, just messages and only messages
  that have not been deleted by the first user (current user by default).
