2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Extend pinned messages support.

Support them in saved messages and normal groups.
This commit is contained in:
John Preston
2018-10-31 15:29:14 +04:00
parent 6d65cf2382
commit 78da810114
12 changed files with 122 additions and 99 deletions

View File

@@ -4705,13 +4705,6 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
}
} break;
case mtpc_updateChannelPinnedMessage: {
auto &d = update.c_updateChannelPinnedMessage();
if (auto channel = App::channelLoaded(d.vchannel_id.v)) {
channel->setPinnedMessageId(d.vid.v);
}
} break;
case mtpc_updateChannelTooLong: {
auto &d = update.c_updateChannelTooLong();
if (auto channel = App::channelLoaded(d.vchannel_id.v)) {
@@ -4735,6 +4728,28 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
}
} break;
// Pinned message.
case mtpc_updateUserPinnedMessage: {
const auto &d = update.c_updateUserPinnedMessage();
if (const auto user = App::userLoaded(d.vuser_id.v)) {
user->setPinnedMessageId(d.vid.v);
}
} break;
case mtpc_updateChatPinnedMessage: {
const auto &d = update.c_updateChatPinnedMessage();
if (const auto chat = App::chatLoaded(d.vchat_id.v)) {
chat->setPinnedMessageId(d.vid.v);
}
} break;
case mtpc_updateChannelPinnedMessage: {
const auto &d = update.c_updateChannelPinnedMessage();
if (const auto channel = App::channelLoaded(d.vchannel_id.v)) {
channel->setPinnedMessageId(d.vid.v);
}
} break;
////// Cloud sticker sets
case mtpc_updateNewStickerSet: {
auto &d = update.c_updateNewStickerSet();