mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't show 'allowed to speak' on first join.
This commit is contained in:
parent
23156d523c
commit
b23f16e6e4
2 changed files with 17 additions and 5 deletions
|
@ -272,11 +272,6 @@ void GroupCall::setState(State state) {
|
||||||
|
|
||||||
if (state == State::Joined) {
|
if (state == State::Joined) {
|
||||||
stopConnectingSound();
|
stopConnectingSound();
|
||||||
if (!_hadJoinedState) {
|
|
||||||
_hadJoinedState = true;
|
|
||||||
applyGlobalShortcutChanges();
|
|
||||||
_delegate->groupCallPlaySound(Delegate::GroupCallSound::Started);
|
|
||||||
}
|
|
||||||
if (const auto call = _peer->groupCall(); call && call->id() == _id) {
|
if (const auto call = _peer->groupCall(); call && call->id() == _id) {
|
||||||
call->setInCall();
|
call->setInCall();
|
||||||
}
|
}
|
||||||
|
@ -479,6 +474,7 @@ void GroupCall::rejoin(not_null<PeerData*> as) {
|
||||||
applyMeInCallLocally();
|
applyMeInCallLocally();
|
||||||
maybeSendMutedUpdate(wasMuteState);
|
maybeSendMutedUpdate(wasMuteState);
|
||||||
_peer->session().api().applyUpdates(updates);
|
_peer->session().api().applyUpdates(updates);
|
||||||
|
checkFirstTimeJoined();
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
const auto type = error.type();
|
const auto type = error.type();
|
||||||
LOG(("Call Error: Could not join, error: %1").arg(type));
|
LOG(("Call Error: Could not join, error: %1").arg(type));
|
||||||
|
@ -1312,9 +1308,24 @@ void GroupCall::setInstanceConnected(
|
||||||
if (nowCanSpeak) {
|
if (nowCanSpeak) {
|
||||||
notifyAboutAllowedToSpeak();
|
notifyAboutAllowedToSpeak();
|
||||||
}
|
}
|
||||||
|
if (!_hadJoinedState && state() == State::Joined) {
|
||||||
|
checkFirstTimeJoined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupCall::checkFirstTimeJoined() {
|
||||||
|
if (_hadJoinedState || state() != State::Joined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_hadJoinedState = true;
|
||||||
|
applyGlobalShortcutChanges();
|
||||||
|
_delegate->groupCallPlaySound(Delegate::GroupCallSound::Started);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupCall::notifyAboutAllowedToSpeak() {
|
void GroupCall::notifyAboutAllowedToSpeak() {
|
||||||
|
if (!_hadJoinedState) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_delegate->groupCallPlaySound(
|
_delegate->groupCallPlaySound(
|
||||||
Delegate::GroupCallSound::AllowedToSpeak);
|
Delegate::GroupCallSound::AllowedToSpeak);
|
||||||
_allowedToSpeakNotifications.fire({});
|
_allowedToSpeakNotifications.fire({});
|
||||||
|
|
|
@ -250,6 +250,7 @@ private:
|
||||||
|
|
||||||
void checkGlobalShortcutAvailability();
|
void checkGlobalShortcutAvailability();
|
||||||
void checkJoined();
|
void checkJoined();
|
||||||
|
void checkFirstTimeJoined();
|
||||||
void notifyAboutAllowedToSpeak();
|
void notifyAboutAllowedToSpeak();
|
||||||
|
|
||||||
void playConnectingSound();
|
void playConnectingSound();
|
||||||
|
|
Loading…
Add table
Reference in a new issue