summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r--indra/newview/llcallfloater.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index b41f962ffa..1b929eca0e 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -35,6 +35,7 @@
#include "llcallfloater.h"
+#include "llagentdata.h" // for gAgentID
#include "llavatarlist.h"
#include "llbottomtray.h"
#include "llparticipantlist.h"
@@ -46,6 +47,7 @@ LLCallFloater::LLCallFloater(const LLSD& key)
, mSpeakerManager(NULL)
, mPaticipants(NULL)
, mAvatarList(NULL)
+, mVoiceType(VC_LOCAL_CHAT)
{
}
@@ -69,6 +71,8 @@ BOOL LLCallFloater::postBuild()
anchor_panel, this,
getDockTongue(), LLDockControl::TOP));
+ initAgentData();
+
// update list for current session
updateSession();
@@ -110,6 +114,19 @@ void LLCallFloater::updateSession()
if (im_session)
{
mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id);
+ switch (im_session->mType)
+ {
+ case IM_NOTHING_SPECIAL:
+ case IM_SESSION_P2P_INVITE:
+ mVoiceType = VC_PEER_TO_PEER;
+ break;
+ case IM_SESSION_CONFERENCE_START:
+ mVoiceType = VC_AD_HOC_CHAT;
+ break;
+ default:
+ mVoiceType = VC_GROUP_CHAT;
+ break;
+ }
}
if (NULL == mSpeakerManager)
@@ -117,8 +134,10 @@ void LLCallFloater::updateSession()
// by default let show nearby chat participants
mSpeakerManager = LLLocalSpeakerMgr::getInstance();
lldebugs << "Set DEFAULT speaker manager" << llendl;
+ mVoiceType = VC_LOCAL_CHAT;
}
+ updateTitle();
refreshPartisipantList();
}
@@ -129,10 +148,52 @@ 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);
+
+ if (!do_not_use_context_menu_in_local_chat)
+ {
+ mAvatarList->setNoItemsCommentText(getString("no_one_near"));
+ }
}
void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
{
updateSession();
}
+
+void LLCallFloater::updateTitle()
+{
+ LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
+ std::string title;
+ switch (mVoiceType)
+ {
+ case VC_LOCAL_CHAT:
+ title = getString("title_nearby");
+ break;
+ case VC_PEER_TO_PEER:
+ title = voice_channel->getSessionName();
+ break;
+ case VC_AD_HOC_CHAT:
+ title = getString("title_adhoc");
+ break;
+ case VC_GROUP_CHAT:
+ LLStringUtil::format_map_t args;
+ args["[GROUP]"] = voice_channel->getSessionName();
+ title = getString("title_group", args);
+ break;
+ }
+
+ setTitle(title);
+}
+
+void LLCallFloater::initAgentData()
+{
+ childSetValue("user_icon", gAgentID);
+
+ std::string name;
+ gCacheName->getFullName(gAgentID, name);
+ childSetValue("user_text", name);
+
+ LLOutputMonitorCtrl* speaking_indicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
+ speaking_indicator->setSpeakerId(gAgentID);
+}
//EOF