2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Track multiple pinned messages in MessagesList.

This commit is contained in:
John Preston
2020-10-09 15:56:33 +03:00
parent 399b03beb2
commit ec35e3f081
19 changed files with 435 additions and 107 deletions

View File

@@ -383,9 +383,7 @@ void ChannelData::setUnavailableReasons(
void ChannelData::setAvailableMinId(MsgId availableMinId) {
if (_availableMinId != availableMinId) {
_availableMinId = availableMinId;
if (pinnedMessageId() <= _availableMinId) {
clearPinnedMessage();
}
clearPinnedMessages(_availableMinId + 1);
}
}
@@ -772,9 +770,9 @@ void ApplyChannelUpdate(
}
}
if (const auto pinned = update.vpinned_msg_id()) {
channel->setPinnedMessageId(pinned->v);
channel->setTopPinnedMessageId(pinned->v);
} else {
channel->clearPinnedMessage();
channel->clearPinnedMessages();
}
if (channel->isMegagroup()) {
const auto stickerSet = update.vstickerset();