From be64f18e96f0331a014ff254eec6af6f3db7e332 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 30 Apr 2019 14:01:34 +0400 Subject: [PATCH] Fix dialogs list creation in support mode. --- Telegram/SourceFiles/dialogs/dialogs_entry.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp index 1e0b4aeee4..5e81184b01 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp @@ -57,6 +57,10 @@ void Entry::cachePinnedIndex(int index) { if (_pinnedIndex != index) { const auto wasPinned = isPinnedDialog(); _pinnedIndex = index; + if (session().supportMode()) { + // Force reorder in support mode. + _sortKeyInChatList = 0; + } updateChatListSortPosition(); updateChatListEntry(); if (wasPinned != isPinnedDialog()) { @@ -81,9 +85,9 @@ bool Entry::needUpdateInChatList() const { } void Entry::updateChatListSortPosition() { - if (Auth().supportMode() + if (session().supportMode() && _sortKeyInChatList != 0 - && Auth().settings().supportFixChatsOrder()) { + && session().settings().supportFixChatsOrder()) { updateChatListEntry(); return; } @@ -95,6 +99,8 @@ void Entry::updateChatListSortPosition() { : DialogPosFromDate(adjustedChatListTimeId()); if (needUpdateInChatList()) { setChatListExistence(true); + } else { + _sortKeyInChatList = 0; } } @@ -209,8 +215,8 @@ void Entry::updateChatListEntry() const { mainChatListLink(Mode::Important)); } } - if (Auth().supportMode() - && !Auth().settings().supportAllSearchResults()) { + if (session().supportMode() + && !session().settings().supportAllSearchResults()) { main->repaintDialogRow({ _key, FullMsgId() }); } }