MDL-65566 core_user: remove the conversation creation code from lib.php
authorJake Dallimore <jake@moodle.com>
Wed, 15 May 2019 07:27:17 +0000 (15:27 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 15 May 2019 10:42:47 +0000 (18:42 +0800)
These are now lazy created in the messaging APIs, so we don't need
to create them on user creation any more.

user/lib.php

index 97303aa..be2e21b 100644 (file)
@@ -126,10 +126,6 @@ function user_create_user($user, $updatepassword = true, $triggerevent = true) {
         \core\event\user_created::create_from_userid($newuserid)->trigger();
     }
 
-    // All new users must have a starred self-conversation.
-    $selfconversation = \core_message\api::create_conversation(\core_message\api::MESSAGE_CONVERSATION_TYPE_SELF, [$newuserid]);
-    \core_message\api::set_favourite_conversation($selfconversation->id, $newuserid);
-
     // Purge the associated caches for the current user only.
     $presignupcache = \cache::make('core', 'presignup');
     $presignupcache->purge_current_user();