2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support special video calls service messages.

This commit is contained in:
John Preston
2020-07-31 20:56:18 +04:00
parent aba8f72c36
commit 6f90e57523
6 changed files with 58 additions and 30 deletions

View File

@@ -974,8 +974,11 @@ void Call::finish(FinishType type, const MTPPhoneCallDiscardReason &reason) {
auto duration = getDurationMs() / 1000;
auto connectionId = _instance ? _instance->getPreferredRelayId() : 0;
_finishByTimeoutTimer.call(kHangupTimeoutMs, [this, finalState] { setState(finalState); });
const auto flags = (_videoState.current() == VideoState::Enabled)
? MTPphone_DiscardCall::Flag::f_video
: MTPphone_DiscardCall::Flag(0);
_api.request(MTPphone_DiscardCall(
MTP_flags(0),
MTP_flags(flags),
MTP_inputPhoneCall(
MTP_long(_id),
MTP_long(_accessHash)),