diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-12 19:24:36 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-12 19:24:36 +0000 |
commit | 9cfae239a98e891773f9279611ad078bda542408 (patch) | |
tree | 56d790c9b1d8a22f5838dbeedf7eef0ed3b9a8f4 /indra/newview/llchathistory.cpp | |
parent | 773e8eb8ea3acc75b0e8137412458f77effffb70 (diff) | |
parent | dc8a9dc57d41723338a0881a29c5652924977ccf (diff) |
viewer2 merge.
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 7a5d8be84a..9368d9cb7c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -259,7 +259,9 @@ public: mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); - if(chat.mFromID.isNull()) + + //*TODO overly defensive thing, source type should be maintained out there + if(chat.mFromID.isNull() || chat.mFromName == SYSTEM_FROM) { mSourceType = CHAT_SOURCE_SYSTEM; } @@ -269,17 +271,13 @@ public: userName->setReadOnlyColor(style_params.readonly_color()); userName->setColor(style_params.color()); - if(!chat.mFromName.empty()) - { - userName->setValue(chat.mFromName); - mFrom = chat.mFromName; - } - else + userName->setValue(chat.mFromName); + if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType) { - std::string SL = LLTrans::getString("SECOND_LIFE"); - userName->setValue(SL); + userName->setValue(LLTrans::getString("SECOND_LIFE")); } + mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; setTimeField(chat); @@ -289,20 +287,17 @@ public: if(mSourceType != CHAT_SOURCE_AGENT) icon->setDrawTooltip(false); - if(!chat.mFromID.isNull()) + switch (mSourceType) { - if(mSourceType != CHAT_SOURCE_AGENT) - icon->setValue(LLSD("OBJECT_Icon")); - else + case CHAT_SOURCE_AGENT: icon->setValue(chat.mFromID); - - - } - else if (userName->getValue().asString()==LLTrans::getString("SECOND_LIFE")) - { - icon->setValue(LLSD("SL_Logo")); + break; + case CHAT_SOURCE_OBJECT: + icon->setValue(LLSD("OBJECT_Icon")); + break; + case CHAT_SOURCE_SYSTEM: + icon->setValue(LLSD("SL_Logo")); } - } /*virtual*/ void draw() |