diff options
author | James Cook <james@lindenlab.com> | 2010-03-29 16:55:22 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-03-29 16:55:22 -0700 |
commit | ecc2c726502448076295254714c0bfa8c0074f25 (patch) | |
tree | 6a9434c540f7b5ea7bca326df1a420e4a0a99cc4 /indra/newview/llimview.cpp | |
parent | d2f9e34598621f1dabad15025417efd6b81dddf0 (diff) | |
parent | ac103403160e87bb6b40ac3e032d077a3381da8e (diff) |
Merge latest viewer-hotfix, approximately equal to Viewer 2.0 final
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 2d3971ff43..52ac2dbca4 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -609,7 +609,7 @@ bool LLIMModel::clearSession(const LLUUID& session_id) return true; } -void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages, int start_index) +void LLIMModel::getMessagesSilently(const LLUUID& session_id, std::list<LLSD>& messages, int start_index) { LLIMSession* session = findIMSession(session_id); if (!session) @@ -629,6 +629,16 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages, messages.push_back(*iter); i--; } +} + +void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id) +{ + LLIMSession* session = findIMSession(session_id); + if (!session) + { + llwarns << "session " << session_id << "does not exist " << llendl; + return; + } session->mNumUnread = 0; session->mParticipantUnreadMessageCount = 0; @@ -640,6 +650,13 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages, mNoUnreadMsgsSignal(arg); } +void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages, int start_index) +{ + getMessagesSilently(session_id, messages, start_index); + + sendNoUnreadMessages(session_id); +} + bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { LLIMSession* session = findIMSession(session_id); @@ -718,13 +735,22 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, return NULL; } - addToHistory(session_id, from, from_id, utf8_text); - if (log2file) logToFile(session_id, from, from_id, utf8_text); + // replace interactive system message marker with correct from string value + std::string from_name = from; + if (INTERACTIVE_SYSTEM_FROM == from) + { + from_name = SYSTEM_FROM; + } + + addToHistory(session_id, from_name, from_id, utf8_text); + if (log2file) logToFile(session_id, from_name, from_id, utf8_text); session->mNumUnread++; //update count of unread messages from real participant - if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from)) + if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) + // we should increment counter for interactive system messages() + || INTERACTIVE_SYSTEM_FROM == from) { ++(session->mParticipantUnreadMessageCount); } |