mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +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
|
@ -123,7 +123,14 @@ class migrate_message_data extends \core\task\adhoc_task {
|
|||
global $DB;
|
||||
|
||||
if (!$conversationid = \core_message\api::get_conversation_between_users([$userid, $otheruserid])) {
|
||||
$conversationid = \core_message\api::create_conversation_between_users([$userid, $otheruserid]);
|
||||
$conversation = \core_message\api::create_conversation(
|
||||
\core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL,
|
||||
[
|
||||
$userid,
|
||||
$otheruserid
|
||||
]
|
||||
);
|
||||
$conversationid = $conversation->id;
|
||||
}
|
||||
|
||||
// First, get the rows from the 'message' table.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue