summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-02-12 15:15:49 +0200
committerIgor Borovkov <iborovkov@productengine.com>2010-02-12 15:15:49 +0200
commit8b609519ea46b785e529c83067ede3656fc10828 (patch)
tree56eaae9b83025b112183445404c43aec2a3db51e /indra/newview/llchathistory.cpp
parentb1fad9d38c70974a38662d642fc813b2db204c53 (diff)
fixed reopened EXT-926 System notification toast has avatar's icon
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp35
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()