summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationlog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llconversationlog.cpp')
-rw-r--r--indra/newview/llconversationlog.cpp27
1 files changed, 25 insertions, 2 deletions
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);