summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-12 14:01:22 -0700
committerJames Cook <james@lindenlab.com>2010-05-12 14:01:22 -0700
commitd36cffcb7b6b7eaed4e110dd1c92d0e397e7cfe6 (patch)
tree6fd6ba2d59b6b7fe0363ea84ddc488960ac21abe
parentdf20016e9eab26334b06d43dc39d5e688cb0487e (diff)
DEV-50013 IM inline text uses display names
Reviewed with Leyla
-rw-r--r--indra/newview/llchathistory.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 0fc5e92324..b3f9bb1dc1 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -242,12 +242,6 @@ public:
mAvatarID = chat.mFromID;
mSessionID = chat.mSessionID;
mSourceType = chat.mSourceType;
- //gCacheName->get(mAvatarID, false, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3));
- if (mAvatarID.notNull())
- {
- LLAvatarNameCache::get(mAvatarID,
- boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2));
- }
//*TODO overly defensive thing, source type should be maintained out there
if((chat.mFromID.isNull() && chat.mFromName.empty()) || chat.mFromName == SYSTEM_FROM)
@@ -260,14 +254,19 @@ public:
userName->setReadOnlyColor(style_params.readonly_color());
userName->setColor(style_params.color());
- userName->setValue(chat.mFromName);
- mFrom = chat.mFromName;
- if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType)
+ if (chat.mFromName.empty()
+ || mSourceType == CHAT_SOURCE_SYSTEM
+ || mAvatarID.isNull())
{
mFrom = LLTrans::getString("SECOND_LIFE");
userName->setValue(mFrom);
}
-
+ else
+ {
+ // ...from a normal user, lookup the name and fill in later
+ LLAvatarNameCache::get(mAvatarID,
+ boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2));
+ }
mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING;
@@ -324,21 +323,15 @@ public:
LLPanel::draw();
}
- void nameUpdatedCallback(const LLUUID& id,const std::string& full_name, bool is_group)
- {
- if (id != mAvatarID)
- return;
- mFrom = full_name;
- }
-
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
{
- if (agent_id != mAvatarID) return;
+ mFrom = av_name.mDisplayName;
- // HACK: just update tooltip
- setToolTip( av_name.mSLID );
LLTextBox* user_name = getChild<LLTextBox>("user_name");
+ user_name->setValue( LLSD(av_name.mDisplayName ) );
+
user_name->setToolTip( av_name.mSLID );
+ setToolTip( av_name.mSLID );
}
protected: