Skip to content

Commit

Permalink
Version 1.6.4: Fix leaving + rejoining for channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Mar 25, 2019
1 parent 09ff556 commit 9b247ce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Telegram/SourceFiles/history/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,13 @@ void History::clearBlocks(bool leaveItems) {
if (leaveItems) {
_owner->notifyHistoryUnloaded(this);
} else {
setLastMessage(nullptr);
if (peer->isChannel()) {
// We left the channel.
_lastMessage = std::nullopt;
} else {
// History was deleted.
setLastMessage(nullptr);
}
notifies.clear();
_owner->notifyHistoryCleared(this);
}
Expand All @@ -2909,7 +2915,7 @@ void History::clearBlocks(bool leaveItems) {
if (auto channel = peer->asChannel()) {
channel->clearPinnedMessage();
if (const auto feed = channel->feed()) {
// Should be after setLastMessage(nullptr);
// Should be after resetting the _lastMessage.
feed->historyCleared(this);
}
}
Expand Down

0 comments on commit 9b247ce

Please sign in to comment.