summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp56
1 files changed, 29 insertions, 27 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index ffbb8471c2..8f010850f7 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -204,19 +204,16 @@ void on_new_message(const LLSD& msg)
bool conversation_floater_not_focused =
conversation_floater_is_closed || !im_box->hasFocus();
+ // Skip toasting and flashing if we have open window of IM with this session id
+ if (session_floater
+ && session_floater->isInVisibleChain()
+ && !session_floater->isMinimized()
+ && !(session_floater->getHost() && session_floater->getHost()->isMinimized()))
+ {
+ return;
+ }
if ("toast" == action)
{
- // Skip toasting and flashing if we have open window of IM with this session id
- if (session_floater
- && session_floater->isInVisibleChain()
- && session_floater->hasFocus()
- && !session_floater->isMinimized()
- && !(session_floater->getHost() && session_floater->getHost()->isMinimized())
- )
- {
- return;
- }
-
//User is not focused on conversation containing the message
if(session_floater_not_focused)
{
@@ -381,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
@@ -582,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
{
@@ -595,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);
@@ -620,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,
@@ -924,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;