diff options
author | Igor Borovkov <iborovkov@productengine.com> | 2010-02-04 17:26:44 +0200 |
---|---|---|
committer | Igor Borovkov <iborovkov@productengine.com> | 2010-02-04 17:26:44 +0200 |
commit | f2bb59300a0f17e10857b3fffebe669878f0fe50 (patch) | |
tree | 62e1fe6d993d456b56625306bc788d4efc057a6d | |
parent | 29a5e29ddb72ae141345753db269d3f2dbfd195c (diff) |
fixed duplicating of log records for EXT-4777 Implement saving and loading chat history for Nearby Chat (both plain text and widgeted chat)
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llnearbychat.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index acb28bd46f..8fc11d3929 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -200,11 +200,16 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) mMessageArchive.push_back(chat); if(mMessageArchive.size()>200) mMessageArchive.erase(mMessageArchive.begin()); + } - if (gSavedPerAccountSettings.getBOOL("LogChat")) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } + if (args["do_not_log"].asBoolean()) + { + return; + } + + if (gSavedPerAccountSettings.getBOOL("LogChat")) + { + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } } @@ -275,6 +280,9 @@ void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) void LLNearbyChat::loadHistory() { + LLSD do_not_log; + do_not_log["do_not_log"] = true; + std::list<LLSD> history; LLLogChat::loadAllHistory("chat", history); @@ -295,7 +303,7 @@ void LLNearbyChat::loadHistory() chat.mFromID = from_id; chat.mText = msg[IM_TEXT].asString(); chat.mTimeStr = msg[IM_TIME].asString(); - addMessage(chat); + addMessage(chat, true, do_not_log); it++; } |