2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix discarded group call handle.

This commit is contained in:
John Preston
2021-03-19 00:57:16 +04:00
parent 9cfbccf9e7
commit ba41da7b28
4 changed files with 27 additions and 11 deletions

View File

@@ -218,7 +218,7 @@ void GroupCall::enqueueUpdate(const MTPUpdate &update) {
_queuedUpdates.emplace(std::pair{ version, type }, update);
}
}, [&](const MTPDgroupCallDiscarded &data) {
discard();
discard(data);
});
}, [&](const MTPDupdateGroupCallParticipants &updateData) {
const auto version = updateData.vversion().v;
@@ -255,7 +255,7 @@ void GroupCall::enqueueUpdate(const MTPUpdate &update) {
processQueuedUpdates();
}
void GroupCall::discard() {
void GroupCall::discard(const MTPDgroupCallDiscarded &data) {
const auto id = _id;
const auto peer = _peer;
crl::on_main(&peer->session(), [=] {
@@ -267,6 +267,14 @@ void GroupCall::discard() {
}
}
});
Core::App().calls().applyGroupCallUpdateChecked(
&peer->session(),
MTP_updateGroupCall(
MTP_int(peer->bareId()),
MTP_groupCallDiscarded(
data.vid(),
data.vaccess_hash(),
data.vduration())));
}
void GroupCall::processFullCallUsersChats(const MTPphone_GroupCall &call) {
@@ -293,7 +301,7 @@ void GroupCall::processFullCallFields(const MTPphone_GroupCall &call) {
applyCallFields(data);
}, [&](const MTPDgroupCallDiscarded &data) {
discard();
discard(data);
});
});
}
@@ -343,7 +351,7 @@ void GroupCall::applyEnqueuedUpdate(const MTPUpdate &update) {
applyCallFields(data);
computeParticipantsCount();
}, [&](const MTPDgroupCallDiscarded &data) {
discard();
discard(data);
});
}, [&](const MTPDupdateGroupCallParticipants &data) {
DEBUG_LOG(("Group Call Participants: "