Skip to content

Commit

Permalink
Fix pinned chat to supergroup upgrade bug.
Browse files Browse the repository at this point in the history
Pinned chats were always updated in dialogs list, even after being
migrated to supergroups. That was bringing them back to chats list.
  • Loading branch information
john-preston committed May 24, 2017
1 parent 9665d5c commit 1cc5b22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1cc5b22

Please sign in to comment.