2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-03 13:26:03 +00:00

Apply short topic info from channelMessages.

This commit is contained in:
John Preston
2022-11-08 15:36:46 +04:00
parent 983b6af0b4
commit c7741cb62a
17 changed files with 121 additions and 74 deletions

View File

@@ -152,18 +152,22 @@ void MessagesSearch::searchReceived(
const auto total = int(data.vcount().v);
return FoundMessages{ total, std::move(items), nextToken };
}, [&](const MTPDmessages_channelMessages &data) {
if (const auto channel = _history->peer->asChannel()) {
channel->ptsReceived(data.vpts().v);
} else {
LOG(("API Error: "
"received messages.channelMessages when no channel "
"was passed!"));
}
if (_requestId != 0) {
// Don't apply cached data!
owner.processUsers(data.vusers());
owner.processChats(data.vchats());
}
if (const auto channel = _history->peer->asChannel()) {
channel->ptsReceived(data.vpts().v);
if (_requestId != 0) {
// Don't apply cached data!
channel->processTopics(data.vtopics());
}
} else {
LOG(("API Error: "
"received messages.channelMessages when no channel "
"was passed!"));
}
auto items = HistoryItemsFromTL(&owner, data.vmessages().v);
const auto total = int(data.vcount().v);
return FoundMessages{ total, std::move(items), nextToken };