diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llcallfloater.h | 5 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 9 |
3 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 69a931fd5b..9120990813 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -377,9 +377,31 @@ void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) call_floater->connectToChannel(channel); } +void LLCallFloater::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + LLStringUtil::format_map_t args; + args["[NAME]"] = av_name.getCompleteName(); + std::string title = getString("title_peer_2_peer", args); + setTitle(title); +} + void LLCallFloater::updateTitle() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (mVoiceType == VC_PEER_TO_PEER) + { + LLUUID session_id = voice_channel->getSessionID(); + LLIMModel::LLIMSession* im_session = + LLIMModel::getInstance()->findIMSession(session_id); + if (im_session) + { + LLAvatarNameCache::get(im_session->mOtherParticipantID, + boost::bind(&LLCallFloater::onAvatarNameCache, + this, _1, _2)); + return; + } + } std::string title; switch (mVoiceType) { diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 0a8ea7de39..4ec594a23a 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -40,6 +40,7 @@ class LLAvatarList; class LLAvatarListItem; +class LLAvatarName; class LLNonAvatarCaller; class LLOutputMonitorCtrl; class LLParticipantList; @@ -122,6 +123,10 @@ private: */ void onAvatarListRefreshed(); + /** + * Updates window title with an avatar name + */ + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); void updateTitle(); void initAgentData(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 136ccbca49..38fced9bb2 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1756,11 +1756,9 @@ void LLOutgoingCallDialog::show(const LLSD& key) callee_name = LLTextUtil::formatPhoneNumber(callee_name); } - setTitle(callee_name); - LLSD callee_id = mPayload["other_user_id"]; - // Beautification: Since SLID is in the title bar, and you probably - // recognize this person's voice, just show display name + // Beautification: Since you know who you called, just show display name + std::string title = callee_name; std::string final_callee_name = callee_name; if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION) { @@ -1768,11 +1766,14 @@ void LLOutgoingCallDialog::show(const LLSD& key) if (LLAvatarNameCache::get(callee_id, &av_name)) { final_callee_name = av_name.mDisplayName; + title = av_name.getCompleteName(); } } childSetTextArg("calling", "[CALLEE_NAME]", final_callee_name); childSetTextArg("connecting", "[CALLEE_NAME]", final_callee_name); + setTitle(title); + // for outgoing group calls callee_id == group id == session id setIcon(callee_id, callee_id); |