summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-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