Skip to content

Commit

Permalink
Play the outgoing call sound only in Ringing state.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed May 12, 2017
1 parent b74dea8 commit 9dfd7f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/calls/calls_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ Call::Call(gsl::not_null<Delegate*> delegate, gsl::not_null<UserData*> user, Typ

if (_type == Type::Outgoing) {
setState(State::Requesting);
} else {
startWaitingTrack();
}
startWaitingTrack();
}

void Call::generateModExpFirst(base::const_byte_span randomSeed) {
Expand Down Expand Up @@ -327,9 +328,10 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
if (data.vid.v != _id) {
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());
setState(State::Ringing);
startWaitingTrack();
}
} return true;

Expand Down

0 comments on commit 9dfd7f4

Please sign in to comment.