From a1957fe5c001905c7a4c20ceaab11fa5ace77200 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Jun 2021 19:12:03 +0400 Subject: [PATCH] Stop connecting sound when group call leave starts. --- Telegram/SourceFiles/calls/group/calls_group_call.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index 74ca5a4307..61e021d9c1 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -827,12 +827,15 @@ void GroupCall::setState(State state) { switch (state) { case State::HangingUp: case State::FailedHangingUp: + stopConnectingSound(); _delegate->groupCallPlaySound(Delegate::GroupCallSound::Ended); break; case State::Ended: + stopConnectingSound(); _delegate->groupCallFinished(this); break; case State::Failed: + stopConnectingSound(); _delegate->groupCallFailed(this); break; case State::Connecting: @@ -844,7 +847,12 @@ void GroupCall::setState(State state) { } void GroupCall::playConnectingSound() { - if (_connectingSoundTimer.isActive()) { + const auto state = _state.current(); + if (_connectingSoundTimer.isActive() + || state == State::HangingUp + || state == State::FailedHangingUp + || state == State::Ended + || state == State::Failed) { return; } playConnectingSoundOnce();