summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-29 11:15:23 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-29 11:15:23 -0800
commitf70504c0ef6102b4985292cf87a7f3f6e3a41cbb (patch)
treecb616902181fb1913979340e766beb93e1cd4828 /indra/newview/llimview.cpp
parente179add865fef30f6ad86ffd074f267fd01cb41d (diff)
parentacd28e28bc6ff48789ba321a470f05f7162ddd46 (diff)
merge
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp49
1 files changed, 27 insertions, 22 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 433ddad35d..8f010850f7 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -237,7 +237,7 @@ void on_new_message(const LLSD& msg)
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
}
}
- }
+ }
}
else if ("flash" == action)
@@ -273,9 +273,9 @@ void on_new_message(const LLSD& msg)
if(!gAgent.isDoNotDisturb())
{
- //Surface conversations floater
- LLFloaterReg::showInstance("im_container");
- }
+ //Surface conversations floater
+ LLFloaterReg::showInstance("im_container");
+ }
//If in DND mode, allow notification to be stored so upon DND exit
//useMostItrusiveIMNotification will be called to notify user a message exists
@@ -284,8 +284,8 @@ void on_new_message(const LLSD& msg)
&& gAgent.isDoNotDisturb())
{
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
- }
-}
+ }
+ }
}
}
@@ -378,15 +378,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
}
buildHistoryFileName();
-
- if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
- {
- std::list<LLSD> chat_history;
-
- //involves parsing of a chat history
- LLLogChat::loadChatHistory(mHistoryFileName, chat_history);
- addMessagesFromHistory(chat_history);
- }
+ loadHistory();
// Localizing name of ad-hoc session. STORM-153
// Changing name should happen here- after the history file was created, so that
@@ -579,11 +571,11 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo
{
const LLSD& msg = *it;
- std::string from = msg[IM_FROM];
+ std::string from = msg[LL_IM_FROM];
LLUUID from_id;
- if (msg[IM_FROM_ID].isDefined())
+ if (msg[LL_IM_FROM_ID].isDefined())
{
- from_id = msg[IM_FROM_ID].asUUID();
+ from_id = msg[LL_IM_FROM_ID].asUUID();
}
else
{
@@ -592,8 +584,8 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& histo
gCacheName->getUUID(legacy_name, from_id);
}
- std::string timestamp = msg[IM_TIME];
- std::string text = msg[IM_TEXT];
+ std::string timestamp = msg[LL_IM_TIME];
+ std::string text = msg[LL_IM_TEXT];
addMessage(from, from_id, text, timestamp, true);
@@ -617,6 +609,20 @@ void LLIMModel::LLIMSession::chatFromLogFile(LLLogChat::ELogLineType type, const
}
}
+void LLIMModel::LLIMSession::loadHistory()
+{
+ mMsgs.clear();
+
+ if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
+ {
+ std::list<LLSD> chat_history;
+
+ //involves parsing of a chat history
+ LLLogChat::loadChatHistory(mHistoryFileName, chat_history);
+ addMessagesFromHistory(chat_history);
+ }
+}
+
LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const
{
return get_if_there(mId2SessionMap, session_id,
@@ -921,8 +927,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from,
bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text)
{
- if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")
- && gSavedSettings.getBOOL("KeepConversationLogTranscripts"))
+ if (gSavedSettings.getS32("KeepConversationLogTranscripts") > 1)
{
std::string from_name = from;