MDL-64017 core_message: pass conversation type to processors

This commit is contained in:
Mark Nelson 2019-03-25 10:51:46 +08:00
parent 9bc1b8f8da
commit ca754fc8c2
2 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,8 @@ class manager {
// Get conversation type and name. We'll use this to determine which message subject to generate, depending on type.
$conv = $DB->get_record('message_conversations', ['id' => $eventdata->convid], 'id, type, name');
$localisedeventdata->conversationtype = $conv->type;
// We treat individual conversations the same as any direct message with 'userfrom' and 'userto' specified.
// We know the other user, so set the 'userto' field so that the event code will get access to this field.
// If this was a legacy caller (eventdata->userto is set), then use that instead, as we want to use the fields specified

View File

@ -77,6 +77,9 @@ class message {
/** @var int The conversation id where userfrom is sending this message. */
private $convid;
/** @var int The conversation type, eg. \core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL */
private $conversationtype;
/** @var object|int The user who is receiving from which is sending this message. */
private $userto;
@ -133,6 +136,7 @@ class message {
'name',
'userfrom',
'convid',
'conversationtype',
'userto',
'subject',
'fullmessage',