MDL-63691 core_message: added api::create_conversation

This commit is contained in:
Mark Nelson 2018-10-18 14:23:19 +08:00
parent e66b915c40
commit f2ac0a3e5b
7 changed files with 186 additions and 16 deletions

View file

@ -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.