mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 06:37:24 +02:00
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(
|
||||
const MTPVector<MTPUpdate> &updates,
|
||||
bool skipMessageIds) {
|
||||
for (const auto &update : updates.v) {
|
||||
if (skipMessageIds && update.type() == mtpc_updateMessageID) {
|
||||
auto list = updates.v;
|
||||
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;
|
||||
}
|
||||
feedUpdate(update);
|
||||
feedUpdate(entry);
|
||||
}
|
||||
session().data().sendHistoryChangeNotifications();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue