-
Sub-task
-
Resolution: Fixed
-
Blocker
-
2.8
-
MOODLE_28_STABLE
-
MOODLE_28_STABLE
-
core_message_get_messages: Function for retrieving user's conversations or notifications (both received/send messages)
It seems that the current message external functions seems to work only for the current user accessing the service (get_contacts doesn't has any input parameter)
It doesn't feel correct to me since the current message API support the "moodle/site:readallmessages" capability, so you can read other user's conversations. Also, functions like get_contacts supports the user parameter.
So my plan is to implement this new external function with the following parameters:
$userid - The user we want to get the notifications
$userfrom = If we want to filter from users
$type = conversations, notifications or both
$read = true or false, retrieve only messages read or not read (Not both, limitfrom and limitnum will not work with both)
$newestfirst - sort order
$limitfrom - Return a subset of records, starting at this one
$limitnum - Number of records to return