diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-12-16 18:14:15 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-12-16 18:14:15 +0200 |
commit | 0ec2bacfac207451386b55006f94e917f1277edc (patch) | |
tree | b091300523e7566ba888215edfc0fedb3615c0d1 | |
parent | 5370d9f35bc5aac49dbb8f065c13f094879ed436 (diff) |
Work on EXT-3431 Implement 'mute/unmute everyone else' moderation in the voice control panel
-- changed behavior of 'mute/unmute everyone else' action to disable/enable voice chat and allow/disallow selected participant
Improvements to have more intellectual processing of several following requests is necessary
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llimview.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llspeakers.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llspeakers.h | 7 |
3 files changed, 49 insertions, 0 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1d56fc0cab..ad30b844a9 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2733,6 +2733,11 @@ public: { im_floater->processSessionUpdate(input["body"]["info"]); } + LLIMSpeakerMgr* im_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); + if (im_mgr) + { + im_mgr->processSessionUpdate(input["body"]["info"]); + } } }; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 1b9fee650e..da7910d8b4 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -659,6 +659,11 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avatar_id, bool unmute) { + // TODO: mantipov: add more intellectual processing of several following requests + + mReverseVoiceModeratedAvatarID = excluded_avatar_id; + moderateVoiceSession(getSessionID(), !unmute);
+/* LLSpeakerMgr::speaker_list_t speakers; getSpeakerList(&speakers, FALSE); @@ -672,6 +677,38 @@ void LLIMSpeakerMgr::moderateVoiceOtherParticipants(const LLUUID& excluded_avata moderateVoiceParticipant(speaker_id, unmute); } +*/ +} + +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"]; + + moderateVoiceParticipant(mReverseVoiceModeratedAvatarID, voice_moderated); + + mReverseVoiceModeratedAvatarID = LLUUID::null; + } +} + +void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallow_voice) +{ + std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + LLSD data; + data["method"] = "session update"; + data["session-id"] = session_id; + data["params"] = LLSD::emptyMap(); + + data["params"]["update_info"] = LLSD::emptyMap(); + + data["params"]["update_info"]["moderated_mode"] = LLSD::emptyMap(); + data["params"]["update_info"]["moderated_mode"]["voice"] = disallow_voice; + + LLHTTPClient::post(url, data, new ModerationResponder(session_id)); } diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 6f7a1d2c49..55d2351cbf 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -186,8 +186,15 @@ public: * @see moderateVoiceParticipant() */ void moderateVoiceOtherParticipants(const LLUUID& excluded_avatar_id, bool unmute); + + void processSessionUpdate(const LLSD& session_update); + protected: virtual void updateSpeakerList(); + + void moderateVoiceSession(const LLUUID& session_id, bool disallow_voice); + + LLUUID mReverseVoiceModeratedAvatarID; }; class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr> |