MDL-63303 message: fix bugs in message drawer part 3

* Fix bug for newly created conversations being added to overview page
* Fixed bug with use enter to send preference not updating correctly
* Fix unit tests
* Fix race condition loading new messages while conversation resetting
* Fix ordering and rendering of messages with same timestamp
* Fix missing privacy info in get_conversation web service
* Fix linting errors
* Improve bulk message rendering
This commit is contained in:
Ryan Wyllie
2018-11-15 14:43:21 +08:00
parent a111ab44af
commit 663ccd58ed
18 changed files with 102 additions and 61 deletions
+5 -2
View File
@@ -855,6 +855,7 @@ class api {
$userid,
$conversationid,
$includecontactrequests,
$includeprivacyinfo,
$memberoffset,
$memberlimit
);
@@ -2897,18 +2898,20 @@ class api {
* @param int $userid The user we are returning the conversation members for, used by helper::get_member_info.
* @param int $conversationid The id of the conversation
* @param bool $includecontactrequests Do we want to include contact requests with this data?
* @param bool $includeprivacyinfo Do we want to include privacy requests with this data?
* @param int $limitfrom
* @param int $limitnum
* @return array
*/
public static function get_conversation_members(int $userid, int $conversationid, bool $includecontactrequests = false,
int $limitfrom = 0, int $limitnum = 0) : array {
bool $includeprivacyinfo = false, int $limitfrom = 0,
int $limitnum = 0) : array {
global $DB;
if ($members = $DB->get_records('message_conversation_members', ['conversationid' => $conversationid],
'timecreated ASC, id ASC', 'userid', $limitfrom, $limitnum)) {
$userids = array_keys($members);
$members = helper::get_member_info($userid, $userids, $includecontactrequests);
$members = helper::get_member_info($userid, $userids, $includecontactrequests, $includeprivacyinfo);
return $members;
}