mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-65344_master' of git://github.com/markn86/moodle
This commit is contained in:
commit
e867ffd689
3 changed files with 22 additions and 3 deletions
|
@ -2386,10 +2386,14 @@ class api {
|
|||
public static function get_conversation_between_users(array $userids) {
|
||||
global $DB;
|
||||
|
||||
$conversations = self::get_individual_conversations_between_users([$userids]);
|
||||
$conversation = $conversations[0];
|
||||
if (empty($userids)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($conversation) {
|
||||
$hash = helper::get_conversation_hash($userids);
|
||||
|
||||
if ($conversation = $DB->get_record('message_conversations', ['type' => self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL,
|
||||
'convhash' => $hash])) {
|
||||
return $conversation->id;
|
||||
}
|
||||
|
||||
|
@ -2415,12 +2419,16 @@ class api {
|
|||
*
|
||||
* Where null is returned for the pairing of [3, 4] since no record exists.
|
||||
*
|
||||
* @deprecated since 3.8
|
||||
* @param array $useridsets An array of arrays where the inner array is the set of user ids
|
||||
* @return stdClass[] Array of conversation records
|
||||
*/
|
||||
public static function get_individual_conversations_between_users(array $useridsets) : array {
|
||||
global $DB;
|
||||
|
||||
debugging('\core_message\api::get_individual_conversations_between_users is deprecated and no longer used',
|
||||
DEBUG_DEVELOPER);
|
||||
|
||||
if (empty($useridsets)) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue