mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-65566 core_message: let get_self_conversation use lazy init too
This commit is contained in:
parent
510ede5698
commit
7918a0ea4c
@ -2454,6 +2454,7 @@ class api {
|
||||
*/
|
||||
public static function get_self_conversation(int $userid) {
|
||||
global $DB;
|
||||
self::lazy_create_self_conversation($userid);
|
||||
|
||||
$conditions = [
|
||||
'type' => self::MESSAGE_CONVERSATION_TYPE_SELF,
|
||||
|
@ -827,8 +827,9 @@ class core_message_api_testcase extends core_message_messagelib_testcase {
|
||||
$this->assertEquals($user2->id, $member->id);
|
||||
|
||||
\core_message\api::delete_all_conversation_data($rsc3->id);
|
||||
$rsc3 = \core_message\api::get_self_conversation($user3->id);
|
||||
$this->assertFalse($rsc3);
|
||||
$selfconversation = \core_message\api::get_self_conversation($user3->id);
|
||||
$members = \core_message\api::get_conversation_members($user1->id, $selfconversation->id);
|
||||
$this->assertCount(1, $members);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user