1
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-03-25 04:38:23 +00:00

Fix phone call decline reason.

If the call was declined fast enough the reason was hangup while it
should be busy.
This commit is contained in:
John Preston 2017-06-11 22:26:13 +02:00
parent 80273c57d0
commit 2de96682db

View File

@ -231,7 +231,7 @@ void Call::hangup() {
_delegate->callFinished(this);
} else {
auto missed = (_state == State::Ringing || (_state == State::Waiting && _type == Type::Outgoing));
auto declined = (_state == State::WaitingIncoming);
auto declined = isIncomingWaiting();
auto reason = missed ? MTP_phoneCallDiscardReasonMissed() :
declined ? MTP_phoneCallDiscardReasonBusy() : MTP_phoneCallDiscardReasonHangup();
finish(FinishType::Ended, reason);