diff options
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 75 |
1 files changed, 66 insertions, 9 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d82c088997..ad59c780f3 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -42,14 +42,45 @@ #include "llspeakers.h" +class LLNonAvatarCaller : public LLAvatarListItem +{ +public: + LLNonAvatarCaller() : LLAvatarListItem(false) + { + + } + BOOL postBuild() + { + BOOL rv = LLAvatarListItem::postBuild(); + + if (rv) + { + setOnline(true); + showLastInteractionTime(false); + setShowProfileBtn(false); + setShowInfoBtn(false); + } + return rv; + } + + void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); } +}; + + +static void* create_non_avatar_caller(void*) +{ + return new LLNonAvatarCaller; +} + LLCallFloater::LLCallFloater(const LLSD& key) : LLDockableFloater(NULL, key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) +, mNonAvatarCaller(NULL) , mVoiceType(VC_LOCAL_CHAT) { - + mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); } LLCallFloater::~LLCallFloater() @@ -66,6 +97,7 @@ BOOL LLCallFloater::postBuild() mAvatarList = getChild<LLAvatarList>("speakers_list"); childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); + mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller"); LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_panel"); @@ -161,14 +193,33 @@ void LLCallFloater::updateSession() void LLCallFloater::refreshPartisipantList() { delete mPaticipants; + mPaticipants = NULL; mAvatarList->clear(); - 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); + bool non_avatar_caller = false; + if (VC_PEER_TO_PEER == mVoiceType) + { + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSpeakerManager->getSessionID()); + non_avatar_caller = !session->mOtherParticipantIsAvatar; + if (non_avatar_caller) + { + mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID); + mNonAvatarCaller->setName(session->mName); + } + } + + mNonAvatarCaller->setVisible(non_avatar_caller); + mAvatarList->setVisible(!non_avatar_caller); - if (!do_not_use_context_menu_in_local_chat) + if (!non_avatar_caller) { - mAvatarList->setNoItemsCommentText(getString("no_one_near")); + 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")); + } } } @@ -189,15 +240,21 @@ void LLCallFloater::updateTitle() title = getString("title_nearby"); break; case VC_PEER_TO_PEER: - title = voice_channel->getSessionName(); + { + LLStringUtil::format_map_t args; + args["[NAME]"] = voice_channel->getSessionName(); + title = getString("title_peer_2_peer", args); + } 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); + { + LLStringUtil::format_map_t args; + args["[GROUP]"] = voice_channel->getSessionName(); + title = getString("title_group", args); + } break; } |