mirror of https://github.com/procxx/kepka.git
Version 1.6.4: Fix leaving + rejoining for channels.
This commit is contained in:
parent
09ff556aa6
commit
9b247ce5ed
|
@ -2897,7 +2897,13 @@ void History::clearBlocks(bool leaveItems) {
|
||||||
if (leaveItems) {
|
if (leaveItems) {
|
||||||
_owner->notifyHistoryUnloaded(this);
|
_owner->notifyHistoryUnloaded(this);
|
||||||
} else {
|
} else {
|
||||||
setLastMessage(nullptr);
|
if (peer->isChannel()) {
|
||||||
|
// We left the channel.
|
||||||
|
_lastMessage = std::nullopt;
|
||||||
|
} else {
|
||||||
|
// History was deleted.
|
||||||
|
setLastMessage(nullptr);
|
||||||
|
}
|
||||||
notifies.clear();
|
notifies.clear();
|
||||||
_owner->notifyHistoryCleared(this);
|
_owner->notifyHistoryCleared(this);
|
||||||
}
|
}
|
||||||
|
@ -2909,7 +2915,7 @@ void History::clearBlocks(bool leaveItems) {
|
||||||
if (auto channel = peer->asChannel()) {
|
if (auto channel = peer->asChannel()) {
|
||||||
channel->clearPinnedMessage();
|
channel->clearPinnedMessage();
|
||||||
if (const auto feed = channel->feed()) {
|
if (const auto feed = channel->feed()) {
|
||||||
// Should be after setLastMessage(nullptr);
|
// Should be after resetting the _lastMessage.
|
||||||
feed->historyCleared(this);
|
feed->historyCleared(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue