From ab9ba5e3ab8cec559513b47cb76c46236293b1e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 13 Jun 2022 12:13:49 +0200 Subject: [PATCH] Revert "Incorrect sort order when the user was removed" This fix is an insufficient fix for the issue: 1. It sorts all conversations strictly by the last message instead of hoisting the unread conversations at the top as it previously worked. 2. The issue is in reading the conversations from the database. Even if the conversation will no longer appear pinned to the top, it will never be able to leave the dropdown either. This reverts commit 04514d926caa0d0d8566e04f58d4ebfce206d09a. --- files/lib/data/conversation/ConversationAction.class.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/files/lib/data/conversation/ConversationAction.class.php b/files/lib/data/conversation/ConversationAction.class.php index 31fa8cc..428c592 100644 --- a/files/lib/data/conversation/ConversationAction.class.php +++ b/files/lib/data/conversation/ConversationAction.class.php @@ -901,12 +901,6 @@ class ConversationAction extends AbstractDatabaseObjectAction implements } } - // Being removed from a conversation might show a different time - // for the last message, requiring the items to be sorted again. - \usort($conversations, static function (ViewableConversation $a, ViewableConversation $b) { - return $b->lastPostTime <=> $a->lastPostTime; - }); - $totalCount = ConversationHandler::getInstance()->getUnreadConversationCount(); if ($count < 10 && $count < $totalCount) { UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount'); -- 2.20.1