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

Discard call in case of an error.

Also add a couple of call error messages.
This commit is contained in:
John Preston
2017-05-09 15:06:21 +03:00
parent 061bd109d2
commit c78cc331d1
4 changed files with 65 additions and 35 deletions

View File

@@ -87,6 +87,7 @@ public:
WaitingInit,
WaitingInitAck,
Established,
FailedHangingUp,
Failed,
HangingUp,
Ended,
@@ -127,9 +128,14 @@ public:
~Call();
private:
enum class FinishType {
None,
Ended,
Failed,
};
void handleRequestError(const RPCError &error);
void handleControllerError(int error);
void finish(const MTPPhoneCallDiscardReason &reason);
void finish(FinishType type, const MTPPhoneCallDiscardReason &reason = MTP_phoneCallDiscardReasonDisconnect());
void startOutgoing();
void startIncoming();
void startWaitingTrack();
@@ -154,7 +160,7 @@ private:
gsl::not_null<UserData*> _user;
Type _type = Type::Outgoing;
State _state = State::Starting;
bool _finishAfterRequestingCall = false;
FinishType _finishAfterRequestingCall = FinishType::None;
base::Observable<State> _stateChanged;
TimeMs _startTime = 0;
base::DelayedCallTimer _finishByTimeoutTimer;