summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llnearbychat.cpp12
-rw-r--r--indra/newview/llnearbychat.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 1dcb6abf81..49ab61556f 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -200,6 +200,18 @@ 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"))
+ {
+ if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT)
+ {
+ LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
+ }
+ else
+ {
+ LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText);
+ }
+ }
}
}
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index 6ea4248578..6ef2a1fee3 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -47,6 +47,8 @@ public:
~LLNearbyChat();
BOOL postBuild ();
+
+ /** @param archive true - to save a message to the chat history log */
void addMessage (const LLChat& message,bool archive = true, const LLSD &args = LLSD());
void onNearbyChatContextMenuItemClicked(const LLSD& userdata);
bool onNearbyChatCheckContextMenuItem(const LLSD& userdata);