2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Load albums of last chat messages.

This commit is contained in:
John Preston
2021-10-04 23:37:55 +04:00
parent 576883ddc8
commit 730412fefe
14 changed files with 253 additions and 122 deletions

View File

@@ -1859,6 +1859,26 @@ void Session::processMessages(
processMessages(data.v, type);
}
void Session::processExistingMessages(
ChannelData *channel,
const MTPmessages_Messages &data) {
data.match([&](const MTPDmessages_channelMessages &data) {
if (channel) {
channel->ptsReceived(data.vpts().v);
} else {
LOG(("App Error: received messages.channelMessages!"));
}
}, [](const auto &) {});
data.match([&](const MTPDmessages_messagesNotModified&) {
LOG(("API Error: received messages.messagesNotModified!"));
}, [&](const auto &data) {
processUsers(data.vusers());
processChats(data.vchats());
processMessages(data.vmessages(), NewMessageType::Existing);
});
}
const Session::Messages *Session::messagesList(ChannelId channelId) const {
if (channelId == NoChannel) {
return &_messages;