summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcallfloater.cpp22
-rw-r--r--indra/newview/llcallfloater.h12
2 files changed, 24 insertions, 10 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index c8d50ceb10..b41f962ffa 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -69,13 +69,17 @@ BOOL LLCallFloater::postBuild()
anchor_panel, this,
getDockTongue(), LLDockControl::TOP));
+ // update list for current session
+ updateSession();
+
+ // subscribe to to be notified Voice Channel is changed
+ LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1));
return TRUE;
}
// virtual
void LLCallFloater::onOpen(const LLSD& /*key*/)
{
- updateSession();
}
//////////////////////////////////////////////////////////////////////////
@@ -110,19 +114,14 @@ void LLCallFloater::updateSession()
if (NULL == mSpeakerManager)
{
- setDefaultSession();
+ // by default let show nearby chat participants
+ mSpeakerManager = LLLocalSpeakerMgr::getInstance();
+ lldebugs << "Set DEFAULT speaker manager" << llendl;
}
refreshPartisipantList();
}
-void LLCallFloater::setDefaultSession()
-{
- // by default let show nearby chat participants
- mSpeakerManager = LLLocalSpeakerMgr::getInstance();
- lldebugs << "Set DEFAULT speaker manager" << llendl;
-}
-
void LLCallFloater::refreshPartisipantList()
{
delete mPaticipants;
@@ -131,4 +130,9 @@ void LLCallFloater::refreshPartisipantList()
bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager;
mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat);
}
+
+void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
+{
+ updateSession();
+}
//EOF
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index db33f17839..bfaa1075c4 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -61,9 +61,19 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
private:
+ /**
+ * Updates mSpeakerManager and list according to current Voice Channel
+ *
+ * It compares mSpeakerManager & current Voice Channel session IDs.
+ * If they are different gets Speaker manager related to current channel and updates channel participant list.
+ */
void updateSession();
- void setDefaultSession();
+
+ /**
+ * Refreshes participant list according to current Voice Channel
+ */
void refreshPartisipantList();
+ void onCurrentChannelChanged(const LLUUID& session_id);
private:
LLSpeakerMgr* mSpeakerManager;