summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimview.cpp5
-rw-r--r--indra/newview/llspeakers.cpp37
-rw-r--r--indra/newview/llspeakers.h7
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>