2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Add members from info to mgInfo->lastParticipants.

This commit is contained in:
John Preston
2017-11-22 13:56:00 +04:00
parent f6ba59ed14
commit 5803edb77b
4 changed files with 47 additions and 8 deletions

View File

@@ -1776,6 +1776,28 @@ void ApiWrap::parseChannelParticipants(
}));
};
void ApiWrap::parseRecentChannelParticipants(
not_null<ChannelData*> channel,
const MTPchannels_ChannelParticipants &result,
base::lambda<void(int fullCount, const QVector<MTPChannelParticipant> &list)> callbackList,
base::lambda<void()> callbackNotModified) {
parseChannelParticipants(result, [&](
int fullCount,
const QVector<MTPChannelParticipant> &list) {
auto applyLast = channel->isMegagroup()
&& (channel->mgInfo->lastParticipants.size() <= list.size());
if (applyLast) {
applyLastParticipantsList(
channel,
fullCount,
list,
false,
true);
}
callbackList(fullCount, list);
}, std::move(callbackNotModified));
}
void ApiWrap::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
switch (updates.type()) {
case mtpc_updateShortMessage: {