diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-02-12 12:05:51 -0800 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-02-12 12:05:51 -0800 |
commit | 426aca61d3c00d57d7066fb1ca5a7be8d138542e (patch) | |
tree | 8ab65d462f97bbd3ab5104c8b4d3ea497866e77a /indra/newview/llchathistory.cpp | |
parent | c61cb61ecc6beca1560a93cdad4ed1bc055c57f9 (diff) | |
parent | 01d462482189abe18a52c293315ab536287b599a (diff) |
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() |