diff options
Diffstat (limited to 'indra/newview/llspeakers.cpp')
-rw-r--r-- | indra/newview/llspeakers.cpp | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 9da3db3032..bf00b47c21 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -251,6 +251,8 @@ bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_ LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : mVoiceChannel(channelp) +, mVoiceModerated(false) +, mModerateModeHandledFirstTime(false) { static LLUICachedControl<F32> remove_delay ("SpeakerParticipantRemoveDelay", 10.0); @@ -297,6 +299,33 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin return speakerp; } +// *TODO: Once way to request the current voice channel moderation mode is implemented +// this method with related code should be removed. +/* + Initializes "moderate_mode" of voice session on first join. + + This is WORKAROUND because a way to request the current voice channel moderation mode exists + but is not implemented in viewer yet. See EXT-6937. +*/ +void LLSpeakerMgr::initVoiceModerateMode() +{ + if (!mModerateModeHandledFirstTime && (mVoiceChannel && mVoiceChannel->isActive())) + { + LLPointer<LLSpeaker> speakerp; + + if (mSpeakers.find(gAgentID) != mSpeakers.end()) + { + speakerp = mSpeakers[gAgentID]; + } + + if (speakerp.notNull()) + { + mVoiceModerated = speakerp->mModeratorMutedVoice; + mModerateModeHandledFirstTime = true; + } + } +} + void LLSpeakerMgr::update(BOOL resort_ok) { if (!LLVoiceClient::getInstance()) @@ -529,7 +558,6 @@ BOOL LLSpeakerMgr::isVoiceActive() // LLIMSpeakerMgr // LLIMSpeakerMgr::LLIMSpeakerMgr(LLVoiceChannel* channel) : LLSpeakerMgr(channel) -, mVoiceModerated(false) { } @@ -762,31 +790,9 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu new ModerationResponder(getSessionID())); } -void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avatar_id, bool unmute_everyone_else) +void LLIMSpeakerMgr::moderateVoiceAllParticipants( bool unmute_everyone ) { - // *TODO: mantipov: add more intellectual processing of several following requests if it is needed. - /* - Such situation should be tested: - "Moderator sends the same second request before first response is come" - Moderator sends "mute everyone else" for A and then for B - two requests to disallow voice chat are sent - UUID of B is stored. - Then first response (to disallow voice chat) is come - request to allow voice for stored avatar (B) - Then second response (to disallow voice chat) is come - have nothing to do, the latest selected speaker is already enabled - - What can happen? - If request to allow voice for stored avatar (B) is processed on server BEFORE - second request to disallow voice chat all speakers will be disabled on voice. - But I'm not sure such situation is possible. - See EXT-3431. - */ - - mReverseVoiceModeratedAvatarID = excluded_avatar_id; - - - if (mVoiceModerated == !unmute_everyone_else) + if (mVoiceModerated == !unmute_everyone) { // session already in requested state. Just force participants which do not match it. forceVoiceModeratedMode(mVoiceModerated); @@ -794,7 +800,7 @@ void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avata else { // otherwise set moderated mode for a whole session. - moderateVoiceSession(getSessionID(), !unmute_everyone_else); + moderateVoiceSession(getSessionID(), !unmute_everyone); } } @@ -804,13 +810,6 @@ void LLIMSpeakerMgr::processSessionUpdate(const LLSD& session_update) session_update["moderated_mode"].has("voice")) { mVoiceModerated = session_update["moderated_mode"]["voice"]; - - if (mReverseVoiceModeratedAvatarID.notNull()) - { - moderateVoiceParticipant(mReverseVoiceModeratedAvatarID, mVoiceModerated); - - mReverseVoiceModeratedAvatarID = LLUUID::null; - } } } |