diff options
author | Eugene Mutavchi <emutavchi@productengine.com> | 2009-11-02 15:51:43 +0200 |
---|---|---|
committer | Eugene Mutavchi <emutavchi@productengine.com> | 2009-11-02 15:51:43 +0200 |
commit | 788b08f525ebfcc52ae1cf351d796594cf71f5c1 (patch) | |
tree | 7d0bbd23fff45fd4e52f6f6674a29324ebce1793 /indra/newview/llimview.cpp | |
parent | 7691860f2e98b38d9304323f20648790552fc754 (diff) |
Fixed normal bug EXT-1877([BSI] Offline status not showing in IMs)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 49fc9d8055..41e2cff3b7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -105,7 +105,13 @@ void toast_callback(const LLSD& msg){ { return; } - + + // Skip toasting for system messages + if (msg["from_id"].asUUID() == LLUUID::null) + { + return; + } + LLSD args; args["MESSAGE"] = msg["message"]; args["TIME"] = msg["time"]; @@ -403,6 +409,23 @@ bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, con return false; } +bool LLIMModel::proccessOnlineOfflineNotification( + const LLUUID& session_id, + const std::string& utf8_text) +{ + // Add message to old one floater + LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); + if ( floater ) + { + if ( !utf8_text.empty() ) + { + floater->addHistoryLine(utf8_text, LLUIColorTable::instance().getColor("SystemChatColor")); + } + } + // Add system message to history + return addMessage(session_id, SYSTEM_FROM, LLUUID::null, utf8_text); +} + bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool log2file /* = true */) { LLIMSession* session = findIMSession(session_id); @@ -2013,7 +2036,7 @@ void LLIMMgr::noteOfflineUsers( { const LLRelationship* info = NULL; LLAvatarTracker& at = LLAvatarTracker::instance(); - LLIMModel* im_model = LLIMModel::getInstance(); + LLIMModel& im_model = LLIMModel::instance(); for(S32 i = 0; i < count; ++i) { info = at.getBuddyInfo(ids.get(i)); @@ -2024,13 +2047,7 @@ void LLIMMgr::noteOfflineUsers( LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[FIRST]", first); offline.setArg("[LAST]", last); - - if (floater) - { - floater->addHistoryLine(offline, LLUIColorTable::instance().getColor("SystemChatColor")); - } - - im_model->addMessage(session_id, SYSTEM_FROM, LLUUID::null, offline); + im_model.proccessOnlineOfflineNotification(session_id, offline); } } } |