2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Better chats list entries management.

Make unread counts and last message base::optional<>.
Remove ChannelHistory.
This commit is contained in:
John Preston
2018-01-31 20:10:29 +03:00
parent edcaccba1f
commit a7f67c4bc9
22 changed files with 1329 additions and 1146 deletions

View File

@@ -849,13 +849,22 @@ void ChannelData::setAvailableMinId(MsgId availableMinId) {
if (auto history = App::historyLoaded(this)) {
history->clearUpTill(availableMinId);
}
if (_pinnedMessageId <= _availableMinId) {
_pinnedMessageId = MsgId(0);
Notify::peerUpdatedDelayed(
this,
Notify::PeerUpdate::Flag::ChannelPinnedChanged);
}
}
}
void ChannelData::setPinnedMessageId(MsgId messageId) {
messageId = (messageId > _availableMinId) ? messageId : MsgId(0);
if (_pinnedMessageId != messageId) {
_pinnedMessageId = messageId;
Notify::peerUpdatedDelayed(this, Notify::PeerUpdate::Flag::ChannelPinnedChanged);
Notify::peerUpdatedDelayed(
this,
Notify::PeerUpdate::Flag::ChannelPinnedChanged);
}
}