Apply updateGroupCallParticipants before updateGroupCall.
This commit is contained in:
parent
b23f16e6e4
commit
76e08af26a
1 changed files with 17 additions and 3 deletions
|
@ -278,11 +278,25 @@ void Updates::checkLastUpdate(bool afterSleep) {
|
||||||
void Updates::feedUpdateVector(
|
void Updates::feedUpdateVector(
|
||||||
const MTPVector<MTPUpdate> &updates,
|
const MTPVector<MTPUpdate> &updates,
|
||||||
bool skipMessageIds) {
|
bool skipMessageIds) {
|
||||||
for (const auto &update : updates.v) {
|
auto list = updates.v;
|
||||||
if (skipMessageIds && update.type() == mtpc_updateMessageID) {
|
const auto needsSorting = ranges::contains(
|
||||||
|
list,
|
||||||
|
mtpc_updateGroupCallParticipants,
|
||||||
|
&MTPUpdate::type);
|
||||||
|
if (needsSorting) {
|
||||||
|
ranges::stable_sort(list, std::less<>(), [](const MTPUpdate &entry) {
|
||||||
|
if (entry.type() == mtpc_updateGroupCallParticipants) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (const auto &entry : std::as_const(list)) {
|
||||||
|
if (skipMessageIds && entry.type() == mtpc_updateMessageID) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
feedUpdate(update);
|
feedUpdate(entry);
|
||||||
}
|
}
|
||||||
session().data().sendHistoryChangeNotifications();
|
session().data().sendHistoryChangeNotifications();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue