mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-63691 core_message: added api::create_conversation
This commit is contained in:
parent
e66b915c40
commit
f2ac0a3e5b
7 changed files with 186 additions and 16 deletions
|
@ -163,8 +163,14 @@ function message_send(\core\message\message $eventdata) {
|
|||
|
||||
if (!$conversationid = \core_message\api::get_conversation_between_users([$eventdata->userfrom->id,
|
||||
$eventdata->userto->id])) {
|
||||
$conversationid = \core_message\api::create_conversation_between_users([$eventdata->userfrom->id,
|
||||
$eventdata->userto->id]);
|
||||
$conversation = \core_message\api::create_conversation(
|
||||
\core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL,
|
||||
[
|
||||
$eventdata->userfrom->id,
|
||||
$eventdata->userto->id
|
||||
]
|
||||
);
|
||||
$conversationid = $conversation->id;
|
||||
}
|
||||
|
||||
$tabledata = new stdClass();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue