summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
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()