summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationlog.cpp24
-rw-r--r--indra/newview/llconversationlog.h8
-rw-r--r--indra/newview/llstartup.cpp12
3 files changed, 27 insertions, 17 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 9ccf9b98f7..f7c61efce0 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -189,16 +189,6 @@ LLConversationLog::LLConversationLog() :
mAvatarNameCacheConnection(),
mLoggingEnabled(false)
{
- if(gSavedPerAccountSettings.controlExists("KeepConversationLogTranscripts"))
- {
- LLControlVariable * keep_log_ctrlp = gSavedPerAccountSettings.getControl("KeepConversationLogTranscripts").get();
- S32 log_mode = keep_log_ctrlp->getValue();
- keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2));
- if (log_mode > 0)
- {
- enableLogging(log_mode);
- }
- }
}
void LLConversationLog::enableLogging(S32 log_mode)
@@ -443,6 +433,20 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s
return true;
}
+void LLConversationLog::initLoggingState()
+{
+ if (gSavedPerAccountSettings.controlExists("KeepConversationLogTranscripts"))
+ {
+ LLControlVariable * keep_log_ctrlp = gSavedPerAccountSettings.getControl("KeepConversationLogTranscripts").get();
+ S32 log_mode = keep_log_ctrlp->getValue();
+ keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2));
+ if (log_mode > 0)
+ {
+ enableLogging(log_mode);
+ }
+ }
+}
+
std::string LLConversationLog::getFileName()
{
std::string filename = "conversation";
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index f241276abb..46e46a3278 100644
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -107,7 +107,7 @@ private:
* To distinguish two conversations with the same sessionID it's also needed to compare their creation date.
*/
-class LLConversationLog : public LLParamSingleton<LLConversationLog>, LLIMSessionObserver
+class LLConversationLog : public LLSingleton<LLConversationLog>, LLIMSessionObserver
{
LLSINGLETON(LLConversationLog);
public:
@@ -148,6 +148,12 @@ public:
bool isLogEmpty() { return mConversations.empty(); }
/**
+ * inits connection to per account settings,
+ * loads saved file and inits enabled state
+ */
+ void initLoggingState();
+
+ /**
* constructs file name in which conversations log will be saved
* file name is conversation.log
*/
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6cbd83d656..a861def704 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -942,12 +942,6 @@ bool idle_startup()
LLFile::mkdir(gDirUtilp->getChatLogsDir());
LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
- //Initialize conversation log only when chat log directories are ready
- if (!LLConversationLog::instanceExists())
- {
- // Check existance since this part can be reached twice if login fails
- LLConversationLog::initParamSingleton();
- }
//good a place as any to create user windlight directories
std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", ""));
@@ -1298,6 +1292,12 @@ bool idle_startup()
LLStartUp::initExperiences();
display_startup();
+
+ // If logging should be enebled, turns it on and loads history from disk
+ // Note: does not happen on init of singleton because preferences can use
+ // this instance without logging in
+ LLConversationLog::getInstance()->initLoggingState();
+
LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT );
return FALSE;