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