mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-63303 message: fix get_conversation_messages
This commit is contained in:
parent
9e189a914d
commit
32b4212e50
@ -1036,12 +1036,8 @@ class api {
|
||||
}
|
||||
}
|
||||
|
||||
$arrmessages = array();
|
||||
if ($messages = helper::get_conversation_messages($userid, $convid, 0, $limitfrom, $limitnum, $sort, $timefrom, $timeto)) {
|
||||
$arrmessages = helper::format_conversation_messages($userid, $convid, $messages);
|
||||
}
|
||||
|
||||
return $arrmessages;
|
||||
$messages = helper::get_conversation_messages($userid, $convid, 0, $limitfrom, $limitnum, $sort, $timefrom, $timeto);
|
||||
return helper::format_conversation_messages($userid, $convid, $messages);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -218,10 +218,13 @@ class helper {
|
||||
$memberids = array_unique(array_map(function($message) {
|
||||
return $message->useridfrom;
|
||||
}, $messages));
|
||||
// Get members information.
|
||||
$arrmembers = self::get_member_info($userid, $memberids);
|
||||
// Add the members to the conversation.
|
||||
$conversation['members'] = $arrmembers;
|
||||
|
||||
if (!empty($memberids)) {
|
||||
// Get members information.
|
||||
$conversation['members'] = self::get_member_info($userid, $memberids);
|
||||
} else {
|
||||
$conversation['members'] = array();
|
||||
}
|
||||
|
||||
return $conversation;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user