summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-09-03 17:52:54 +0300
committerPaul ProductEngine <pguslisty@productengine.com>2012-09-03 17:52:54 +0300
commit7bad109c3d7e6d70649839634586a09033cfb207 (patch)
treead041833645fd9fd73cc2f7acb7d1ae67b545733 /indra
parenteb13b2b4680ab80e8a20d341a481b8c1d62ca156 (diff)
CHUI-314 FIXED (Update Save IM logs on my computer setting to also control populatoin of conversation log)
- Now LLConversationLog is optionally listener of IMSession, dependently on "LogInstantMessages" per account setting, saving of call log to file also depends on this setting. Which means that with the Save IM logs on my computer disabled: IM logs for the user will not be saved to their computer and conversations will not be logged to the conversation log.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewer.cpp5
-rw-r--r--indra/newview/llconversationlog.cpp27
-rw-r--r--indra/newview/llconversationlog.h2
3 files changed, 31 insertions, 3 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 08a1a237f5..4dacde4792 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1834,7 +1834,10 @@ bool LLAppViewer::cleanup()
LLMuteList::getInstance()->cache(gAgent.getID());
//save call log list
- LLConversationLog::instance().cache();
+ if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
+ {
+ LLConversationLog::instance().cache();
+ }
if (mPurgeOnExit)
{
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 23ccc78a0f..7db6a93709 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -185,11 +185,34 @@ LLConversationLog::LLConversationLog()
{
loadFromFile(getFileName());
- LLIMMgr::instance().addSessionObserver(this);
-
+ LLControlVariable* ctrl = gSavedPerAccountSettings.getControl("LogInstantMessages").get();
+ if (ctrl)
+ {
+ ctrl->getSignal()->connect(boost::bind(&LLConversationLog::observeIMSession, this));
+
+ if (ctrl->getValue().asBoolean())
+ {
+ LLIMMgr::instance().addSessionObserver(this);
+ }
+ }
+
mFriendObserver = new LLConversationLogFriendObserver;
LLAvatarTracker::instance().addObserver(mFriendObserver);
+
}
+
+void LLConversationLog::observeIMSession()
+{
+ if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
+ {
+ LLIMMgr::instance().addSessionObserver(this);
+ }
+ else
+ {
+ LLIMMgr::instance().removeSessionObserver(this);
+ }
+}
+
void LLConversationLog::logConversation(const LLConversation& conversation)
{
mConversations.push_back(conversation);
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index f2b6a67c92..9fd54c61c9 100644
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -145,6 +145,8 @@ private:
LLConversationLog();
+ void observeIMSession();
+
/**
* constructs file name in which conversations log will be saved
* file name is conversation.log