summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationlog.cpp
diff options
context:
space:
mode:
authorMaximB ProductEngine <mberezhnoy@productengine.com>2012-11-15 18:49:09 +0200
committerMaximB ProductEngine <mberezhnoy@productengine.com>2012-11-15 18:49:09 +0200
commited202aaad52bcf934e89fd4e51d7217d2990574e (patch)
tree9074b6257550cb3b835b7fbd3b83e462e1348fa0 /indra/newview/llconversationlog.cpp
parentdbc37f6ca74dba6c6d5194e0397d5cfe6f570c1d (diff)
parent7a088e9b2c8ffddbf5cd8dad72281a64a32d7c63 (diff)
merging into latest changes
Diffstat (limited to 'indra/newview/llconversationlog.cpp')
-rw-r--r--indra/newview/llconversationlog.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 3d2b6a5c00..a0765f5e16 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -223,13 +223,17 @@ void LLConversationLog::enableLogging(bool enable)
notifyObservers();
}
-void LLConversationLog::logConversation(const LLUUID& session_id)
+void LLConversationLog::logConversation(const LLUUID& session_id, BOOL has_offline_msg)
{
const LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
LLConversation* conversation = findConversation(session);
if (session && conversation)
{
+ if(has_offline_msg)
+ {
+ updateOfflineIMs(session, has_offline_msg);
+ }
updateConversationTimestamp(conversation);
}
else if (session && !conversation)
@@ -265,7 +269,22 @@ void LLConversationLog::updateConversationName(const LLIMModel::LLIMSession* ses
if (conversation)
{
conversation->setConverstionName(name);
- notifyPrticularConversationObservers(conversation->getSessionID(), LLConversationLogObserver::CHANGED_NAME);
+ notifyParticularConversationObservers(conversation->getSessionID(), LLConversationLogObserver::CHANGED_NAME);
+ }
+}
+
+void LLConversationLog::updateOfflineIMs(const LLIMModel::LLIMSession* session, BOOL new_messages)
+{
+ if (!session)
+ {
+ return;
+ }
+
+ LLConversation* conversation = findConversation(session);
+ if (conversation)
+ {
+ conversation->setOfflineMessages(new_messages);
+ notifyParticularConversationObservers(conversation->getSessionID(), LLConversationLogObserver::CHANGED_OfflineIMs);
}
}
@@ -274,7 +293,7 @@ void LLConversationLog::updateConversationTimestamp(LLConversation* conversation
if (conversation)
{
conversation->updateTimestamp();
- notifyPrticularConversationObservers(conversation->getSessionID(), LLConversationLogObserver::CHANGED_TIME);
+ notifyParticularConversationObservers(conversation->getSessionID(), LLConversationLogObserver::CHANGED_TIME);
}
}
@@ -337,9 +356,9 @@ void LLConversationLog::removeObserver(LLConversationLogObserver* observer)
mObservers.erase(observer);
}
-void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
+void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg)
{
- logConversation(session_id);
+ logConversation(session_id, has_offline_msg);
}
void LLConversationLog::cache()
@@ -477,7 +496,7 @@ void LLConversationLog::notifyObservers()
}
}
-void LLConversationLog::notifyPrticularConversationObservers(const LLUUID& session_id, U32 mask)
+void LLConversationLog::notifyParticularConversationObservers(const LLUUID& session_id, U32 mask)
{
std::set<LLConversationLogObserver*>::const_iterator iter = mObservers.begin();
for (; iter != mObservers.end(); ++iter)
@@ -489,7 +508,7 @@ void LLConversationLog::notifyPrticularConversationObservers(const LLUUID& sessi
void LLConversationLog::onNewMessageReceived(const LLSD& data)
{
const LLUUID session_id = data["session_id"].asUUID();
- logConversation(session_id);
+ logConversation(session_id, false);
}
void LLConversationLog::onAvatarNameCache(const LLUUID& participant_id, const LLAvatarName& av_name, const LLIMModel::LLIMSession* session)