summaryrefslogtreecommitdiff
path: root/indra/newview/llspeakers.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-11-12 09:23:57 -0800
committerRick Pasetto <rick@lindenlab.com>2009-11-12 09:23:57 -0800
commit3dd79ad226bc8e0aec18dba87223a3f50ecf360b (patch)
tree2af4f4e5d50d35065dda3101b60b40a3c1c21aee /indra/newview/llspeakers.cpp
parent72af8dc3f0a249f69869bc6f52dd7a887702a964 (diff)
parent7a45dec2d540581ef080386e4a967befd22b6adb (diff)
merge
Diffstat (limited to 'indra/newview/llspeakers.cpp')
-rw-r--r--indra/newview/llspeakers.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 2341fcfc6d..2ed82b7d62 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -87,6 +87,21 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c
mDisplayName = first + " " + last;
}
+LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source)
+: LLEvent(source, "Speaker add moderator event"),
+ mSpeakerID (source->mID),
+ mIsModerator (source->mIsModerator)
+{
+}
+
+LLSD LLSpeakerUpdateModeratorEvent::getValue()
+{
+ LLSD ret;
+ ret["id"] = mSpeakerID;
+ ret["is_moderator"] = mIsModerator;
+ return ret;
+}
+
LLSpeakerTextModerationEvent::LLSpeakerTextModerationEvent(LLSpeaker* source)
: LLEvent(source, "Speaker text moderation event")
{
@@ -437,9 +452,13 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
if ( speaker_it->second.isMap() )
{
+ BOOL is_moderator = speakerp->mIsModerator;
speakerp->mIsModerator = speaker_it->second["is_moderator"];
speakerp->mModeratorMutedText =
speaker_it->second["mutes"]["text"];
+ // Fire event only if moderator changed
+ if ( is_moderator != speakerp->mIsModerator )
+ fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
}
}
}
@@ -507,7 +526,11 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
if (agent_info.has("is_moderator"))
{
+ BOOL is_moderator = speakerp->mIsModerator;
speakerp->mIsModerator = agent_info["is_moderator"];
+ // Fire event only if moderator changed
+ if ( is_moderator != speakerp->mIsModerator )
+ fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
}
if (agent_info.has("mutes"))