diff options
author | Oz Linden <oz@lindenlab.com> | 2010-10-15 16:40:24 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2010-10-15 16:40:24 -0400 |
commit | 18321756297bd9b04a4204abe4fbb0e3e8112186 (patch) | |
tree | 01e58c48ac8be93161d4a7002232ea7974637a39 /indra/newview/llnearbychat.cpp | |
parent | cc902e3d24c88bd49c591e81506875c5e3782b08 (diff) | |
parent | dd69516213fdf20cbc254214e651c4df26afbff7 (diff) |
pull fix for STORM-279
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 28aea7ae3d..f16cc4cef4 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -55,12 +55,6 @@ static const S32 RESIZE_BAR_THICKNESS = 3; -const static std::string IM_TIME("time"); -const static std::string IM_TEXT("message"); -const static std::string IM_FROM("from"); -const static std::string IM_FROM_ID("from_id"); - - LLNearbyChat::LLNearbyChat(const LLSD& key) : LLDockableFloater(NULL, false, false, key) ,mChatHistory(NULL) @@ -185,7 +179,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) if (gSavedPerAccountSettings.getBOOL("LogNearbyChat")) { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); + LLLogChat::saveHistory("chat", chat); } } @@ -275,8 +269,12 @@ void LLNearbyChat::loadHistory() const LLSD& msg = *it; std::string from = msg[IM_FROM]; - LLUUID from_id = LLUUID::null; - if (msg[IM_FROM_ID].isUndefined()) + LLUUID from_id; + if (msg[IM_FROM_ID].isDefined()) + { + from_id = msg[IM_FROM_ID].asUUID(); + } + else { gCacheName->getUUID(from, from_id); } @@ -288,11 +286,14 @@ void LLNearbyChat::loadHistory() chat.mTimeStr = msg[IM_TIME].asString(); chat.mChatStyle = CHAT_STYLE_HISTORY; - chat.mSourceType = CHAT_SOURCE_AGENT; - if (from_id.isNull() && SYSTEM_FROM == from) + if (msg.has(IM_SOURCE_TYPE)) + { + S32 source_type = msg[IM_SOURCE_TYPE].asInteger(); + chat.mSourceType = (EChatSourceType)source_type; + } + else if (from_id.isNull() && SYSTEM_FROM == from) { chat.mSourceType = CHAT_SOURCE_SYSTEM; - } else if (from_id.isNull()) { |