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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user