summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-05-25 16:17:47 +0300
committerMike Antipov <mantipov@productengine.com>2010-05-25 16:17:47 +0300
commita9398f240d98d0d376091243005cd4aacb97dcd6 (patch)
tree4d4c7f4b2404f88bcd6436cac1b52330eb4d5d47 /indra/newview
parent574e6cb3907ad61747732883c361f114c17809f0 (diff)
EXT-6937 PARTIAL FIXED Enable a possibility to "mute everyone" in case group chat is already in "moderate_mode" state.
Partial fix (until restart moderator's viewer) * store "moderate_mode" session state * if session is already in requested state participants un/mute individually. Known Issue: "moderate_mode" session state is set to false on startup. Thus if moderator join voice chat with disabled voice it has incorrect state. In this case when he sends "Mute everyone" request first time it has effect only to himself. Other unmuted participants are not muted. Next "Mute everyone" request works properly: one request per participant is sent. Reviewed by Aimee Walton at https://codereview.productengine.com/secondlife/r/423/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llspeakers.cpp39
-rw-r--r--indra/newview/llspeakers.h8
2 files changed, 41 insertions, 6 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index c8bb4aa983..9da3db3032 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -529,6 +529,7 @@ BOOL LLSpeakerMgr::isVoiceActive()
// LLIMSpeakerMgr
//
LLIMSpeakerMgr::LLIMSpeakerMgr(LLVoiceChannel* channel) : LLSpeakerMgr(channel)
+, mVoiceModerated(false)
{
}
@@ -783,21 +784,33 @@ void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avata
*/
mReverseVoiceModeratedAvatarID = excluded_avatar_id;
- moderateVoiceSession(getSessionID(), !unmute_everyone_else);
+
+
+ if (mVoiceModerated == !unmute_everyone_else)
+ {
+ // session already in requested state. Just force participants which do not match it.
+ forceVoiceModeratedMode(mVoiceModerated);
+ }
+ else
+ {
+ // otherwise set moderated mode for a whole session.
+ moderateVoiceSession(getSessionID(), !unmute_everyone_else);
+ }
}
void LLIMSpeakerMgr::processSessionUpdate(const LLSD& session_update)
{
- if (mReverseVoiceModeratedAvatarID.isNull()) return;
-
if (session_update.has("moderated_mode") &&
session_update["moderated_mode"].has("voice"))
{
- BOOL voice_moderated = session_update["moderated_mode"]["voice"];
+ mVoiceModerated = session_update["moderated_mode"]["voice"];
- moderateVoiceParticipant(mReverseVoiceModeratedAvatarID, voice_moderated);
+ if (mReverseVoiceModeratedAvatarID.notNull())
+ {
+ moderateVoiceParticipant(mReverseVoiceModeratedAvatarID, mVoiceModerated);
- mReverseVoiceModeratedAvatarID = LLUUID::null;
+ mReverseVoiceModeratedAvatarID = LLUUID::null;
+ }
}
}
@@ -817,6 +830,20 @@ void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallo
LLHTTPClient::post(url, data, new ModerationResponder(session_id));
}
+void LLIMSpeakerMgr::forceVoiceModeratedMode(bool should_be_muted)
+{
+ for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
+ {
+ LLUUID speaker_id = speaker_it->first;
+ LLSpeaker* speakerp = speaker_it->second;
+
+ // participant does not match requested state
+ if (should_be_muted != (bool)speakerp->mModeratorMutedVoice)
+ {
+ moderateVoiceParticipant(speaker_id, !should_be_muted);
+ }
+ }
+}
//
// LLActiveSpeakerMgr
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index 2bb160b7ce..b38acb7bc4 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -303,7 +303,15 @@ protected:
void moderateVoiceSession(const LLUUID& session_id, bool disallow_voice);
+ /**
+ * Process all participants to mute/unmute them according to passed voice session state.
+ */
+ void forceVoiceModeratedMode(bool should_be_muted);
+
+private:
LLUUID mReverseVoiceModeratedAvatarID;
+ bool mVoiceModerated;
+
};
class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr>