summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationlog.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2012-11-14 15:28:05 +0200
committermaxim_productengine <mnikolenko@productengine.com>2012-11-14 15:28:05 +0200
commit40949724345a00a22b1fae5d0645c244cbf47567 (patch)
tree312a8f351880db034b9b31046c03f96f7c19be20 /indra/newview/llconversationlog.cpp
parentdf1fd5d4bbe8e71389872e4cdbac3e9f165cc3f8 (diff)
CHUI-389 FIXED Added parameter for sessionAdded to get access to has_offline_msg value.
Set UnreadIMs icon to visible if messages were sent while offline.
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)