From 8b609519ea46b785e529c83067ede3656fc10828 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 12 Feb 2010 15:15:49 +0200 Subject: fixed reopened EXT-926 System notification toast has avatar's icon --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'indra/newview/llchathistory.cpp') 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() -- cgit v1.2.3