summaryrefslogtreecommitdiff
path: root/indra/newview/llimview.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-03-22 16:12:41 -0700
committerRoxie Linden <roxie@lindenlab.com>2010-03-22 16:12:41 -0700
commit18b7ab0018695e261dbc5058d76f9d371958b034 (patch)
tree9b4baa5a5ca563ace1b06ac6b3df9fd9c0a0d0f7 /indra/newview/llimview.cpp
parent60c4621500e478d66a8bdc3a1c80573be2860fee (diff)
parentbe139dfb957e1b0d3c59110284c43630d3b57d23 (diff)
Weekly automated merge from viewer 2.0
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r--indra/newview/llimview.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 97f26eacb6..06c3a0be50 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -608,10 +608,10 @@ 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)
+ if (!session)
{
llwarns << "session " << session_id << "does not exist " << llendl;
return;
@@ -619,7 +619,7 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages,
int i = session->mMsgs.size() - start_index;
- for (std::list<LLSD>::iterator iter = session->mMsgs.begin();
+ for (std::list<LLSD>::iterator iter = session->mMsgs.begin();
iter != session->mMsgs.end() && i > 0;
iter++)
{
@@ -628,6 +628,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;
@@ -639,6 +649,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);
@@ -717,13 +734,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);
}