summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp25
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())
{