summaryrefslogtreecommitdiff
path: root/indra/newview/llparticipantlist.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-06-11 10:47:35 +0300
committerMike Antipov <mantipov@productengine.com>2010-06-11 10:47:35 +0300
commit53fcb0927539c224a9c078605f9a1164acbb5f53 (patch)
tree4aa1c0aa267648ab634497cf1967814ff31f9268 /indra/newview/llparticipantlist.cpp
parent56d9e64b6da662ef8729ab203bab6142309a79f0 (diff)
EXT-7235 FIXED now mute state (according to the "Moderator muted voice" property) is updated for participants when list is updated
Reason: in both cases the same - moderated mode is not checked when session participant list is filled with participants already in channel (when IM or VCP is created) Fix: added updating of participants' speaker indicator mute state when list is refreshed. Reviewed by Aimee Walton at https://codereview.productengine.com/secondlife/r/476/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llparticipantlist.cpp')
-rw-r--r--indra/newview/llparticipantlist.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index a27afeab7c..8fe78a0f81 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -52,6 +52,18 @@
static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
+// helper function to update AvatarList Item's indicator in the voice participant list
+static void update_speaker_indicator(const LLAvatarList* const avatar_list, const LLUUID& avatar_uuid, bool is_muted)
+{
+ LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(avatar_list->getItemByValue(avatar_uuid));
+ if (item)
+ {
+ LLOutputMonitorCtrl* indicator = item->getChild<LLOutputMonitorCtrl>("speaking_indicator");
+ indicator->setIsMuted(is_muted);
+ }
+}
+
+
// See EXT-4301.
/**
* class LLAvalineUpdater - observe the list of voice participants in session and check
@@ -354,6 +366,20 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
}
}
}
+
+ // update voice mute state of all items. See EXT-7235
+ LLSpeakerMgr::speaker_list_t speaker_list;
+
+ // Use also participants which are not in voice session now (the second arg is TRUE).
+ // They can already have mModeratorMutedVoice set from the previous voice session
+ // and LLSpeakerVoiceModerationEvent will not be sent when speaker manager is updated next time.
+ mSpeakerMgr->getSpeakerList(&speaker_list, TRUE);
+ for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++)
+ {
+ const LLPointer<LLSpeaker>& speakerp = *it;
+
+ update_speaker_indicator(list, speakerp->mID, speakerp->mModeratorMutedVoice);
+ }
}
}
@@ -506,12 +532,7 @@ bool LLParticipantList::onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event
// update UI on confirmation of moderator mutes
if (event->getValue().asString() == "voice")
{
- LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mAvatarList->getItemByValue(speakerp->mID));
- if (item)
- {
- LLOutputMonitorCtrl* indicator = item->getChild<LLOutputMonitorCtrl>("speaking_indicator");
- indicator->setIsMuted(speakerp->mModeratorMutedVoice);
- }
+ update_speaker_indicator(mAvatarList, speakerp->mID, speakerp->mModeratorMutedVoice);
}
return true;
}