From 1cc5b224c76d64575f0aaa19e195b92a571d37e1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 24 May 2017 22:54:41 +0300 Subject: [PATCH] Fix pinned chat to supergroup upgrade bug. Pinned chats were always updated in dialogs list, even after being migrated to supergroups. That was bringing them back to chats list. --- Telegram/SourceFiles/history.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 5379281fe7..fd63c79449 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1859,12 +1859,14 @@ void History::setLastMessage(HistoryItem *msg) { } bool History::needUpdateInChatList() const { - if (inChatList(Dialogs::Mode::All) || isPinnedDialog()) { + if (inChatList(Dialogs::Mode::All)) { return true; } else if (peer->migrateTo()) { return false; + } else if (isPinnedDialog()) { + return true; } - return (!peer->isChannel() || peer->asChannel()->amIn()); + return !peer->isChannel() || peer->asChannel()->amIn(); } void History::setChatsListDate(const QDateTime &date) {