Play the outgoing call sound only in Ringing state.

This commit is contained in:
John Preston 2017-05-12 18:53:59 +03:00
parent b74dea8662
commit 9dfd7f4ba9
1 changed files with 4 additions and 2 deletions

View File

@ -85,8 +85,9 @@ Call::Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Typ
if (_type == Type::Outgoing) { if (_type == Type::Outgoing) {
setState(State::Requesting); setState(State::Requesting);
} else {
startWaitingTrack();
} }
startWaitingTrack();
} }
void Call::generateModExpFirst(base::const_byte_span randomSeed) { void Call::generateModExpFirst(base::const_byte_span randomSeed) {
@ -327,9 +328,10 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
if (data.vid.v != _id) { if (data.vid.v != _id) {
return false; return false;
} }
if (_state == State::Waiting && data.vreceive_date.v != 0) { if (_type == Type::Outgoing && _state == State::Waiting && data.vreceive_date.v != 0) {
_discardByTimeoutTimer.callOnce(Global::CallRingTimeoutMs()); _discardByTimeoutTimer.callOnce(Global::CallRingTimeoutMs());
setState(State::Ringing); setState(State::Ringing);
startWaitingTrack();
} }
} return true; } return true;