From 09f0758f2fce699659a6ebc63962d4f9493f0098 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 17:30:54 -0700 Subject: DEV-50177 IM Session window title bar shows SLID for receiving party Reviewed with Leyla --- indra/newview/llimfloater.cpp | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index d25aa37e16..804cc75f75 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -38,6 +38,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -275,12 +276,6 @@ BOOL LLIMFloater::postBuild() mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); mInputEditor->setPassDelete( TRUE ); - std::string session_name(LLIMModel::instance().getName(mSessionID)); - - mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + session_name); - - setTitle(session_name); - childSetCommitCallback("chat_editor", onSendMsg, this); mChatHistory = getChild("chat_history"); @@ -298,6 +293,19 @@ BOOL LLIMFloater::postBuild() mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); } + if ( im_session && im_session->isP2PSessionType()) + { + // look up display name for window title + LLAvatarNameCache::get(im_session->mOtherParticipantID, + boost::bind(&LLIMFloater::onAvatarNameCache, + this, _1, _2)); + } + else + { + std::string session_name(LLIMModel::instance().getName(mSessionID)); + updateSessionName(session_name, session_name); + } + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -311,6 +319,22 @@ BOOL LLIMFloater::postBuild() } } +void LLIMFloater::updateSessionName(const std::string& ui_title, + const std::string& ui_label) +{ + mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + ui_label); + setTitle(ui_title); +} + +void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + // Use display name only for labels, as the extended name will be in the + // floater title + std::string ui_title = av_name.getNameAndSLID(); + updateSessionName(ui_title, av_name.mDisplayName); +} + // virtual void LLIMFloater::draw() { -- cgit v1.2.3 From d674d11f895b8f3d578cded931cdc1c430379c95 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 17:11:31 -0700 Subject: Rename LLAvatarName::getNameAndSLID() to getCompleteName() Discussed with Leyla/Richard --- indra/newview/llimfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b5b923dcad..1c1d9343aa 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -331,7 +331,7 @@ void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, { // Use display name only for labels, as the extended name will be in the // floater title - std::string ui_title = av_name.getNameAndSLID(); + std::string ui_title = av_name.getCompleteName(); updateSessionName(ui_title, av_name.mDisplayName); } -- cgit v1.2.3 From f70a559d4394a6552da5167c3f450d5f2befa8e2 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 29 Jul 2010 16:33:31 -0700 Subject: DEV-52353 Resident last name shown in user is typing notice in chat --- indra/newview/llimfloater.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 38bb96fd6f..a8ec551e58 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -339,6 +339,7 @@ void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, // floater title std::string ui_title = av_name.getCompleteName(); updateSessionName(ui_title, av_name.mDisplayName); + mTypingStart.setArg("[NAME]", ui_title); } // virtual @@ -1101,13 +1102,9 @@ void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) { mOtherTyping = true; - // Create typing is started title string - LLUIString typing_start(mTypingStart); - typing_start.setArg("[NAME]", im_info->mName); - // Save and set new title mSavedTitle = getTitle(); - setTitle (typing_start); + setTitle (mTypingStart); // Update speaker LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); -- cgit v1.2.3 From 128ec0ceaa6efdf24f05c51075853584c3d5acbc Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Mon, 15 Nov 2010 23:01:17 +0200 Subject: STORM-580 FIXED Removed "IM" font color setting as unused. --- indra/newview/llimfloater.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index e000abda2a..bdc0dfa7e2 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -680,8 +680,6 @@ void LLIMFloater::updateMessages() if (messages.size()) { -// LLUIColor chat_color = LLUIColorTable::instance().getColor("IMChatColor"); - LLSD chat_args; chat_args["use_plain_text_chat_history"] = use_plain_text_chat_history; -- cgit v1.2.3