diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2009-11-30 19:59:44 +0200 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2009-11-30 19:59:44 +0200 |
commit | 5ed4c7015641b0739291c7fc75b67aa5b0ed36fc (patch) | |
tree | c451ded3878e52f8226104b25a52b9cb7a473915 /indra | |
parent | 1a622243096d77856cc4ed2590dd99dd480e587e (diff) |
implemented EXT-2962 “Implement adding messages into IM history w/o spawning
chiclet”
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llimview.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llimview.h | 10 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 32 |
3 files changed, 25 insertions, 25 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 827234be6e..21a3ddfd78 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -455,7 +455,13 @@ bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, con { if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), from, from_id, utf8_text); + std::string name = LLIMModel::getInstance()->getName(session_id); + if (name == LLStringUtil::null) + { + name = from; + } + + LLLogChat::saveHistory(name, from, from_id, utf8_text); return true; } else diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 79b0acad69..5cc0b033a2 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -200,17 +200,17 @@ public: void testMessages(); + /** + * Save an IM message into a file + */ + bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); + private: /** * Add message to a list of message associated with session specified by session_id */ bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); - - /** - * Save an IM message into a file - */ - bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); }; class LLIMSessionObserver diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 112d829563..a30f896fa2 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -71,29 +71,23 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); if (session == NULL) { - session_id = LLIMMgr::instance().addSession(name, - IM_NOTHING_SPECIAL, from_id); - session = LLIMModel::instance().findIMSession(session_id); + LLIMModel::instance().logToFile(session_id, name, from_id, + notification->getMessage()); } - - if (session == NULL) + else { - llerrs << "session " << session_id << "does not exist " << llendl; - return; - } + // store active session id + const LLUUID & active_session_id = + LLIMModel::instance().getActiveSessionID(); + // set searched session as active to avoid IM toast popup + LLIMModel::instance().setActiveSessionID(session->mSessionID); - // store active session id - const LLUUID & active_session_id = - LLIMModel::instance().getActiveSessionID(); + LLIMModel::instance().addMessage(session->mSessionID, name, from_id, + notification->getMessage()); - // set created session as active to avoid IM toast popup - LLIMModel::instance().setActiveSessionID(session->mSessionID); - - LLIMModel::instance().addMessage(session->mSessionID, name, from_id, - notification->getMessage()); - - // restore active session id - LLIMModel::instance().setActiveSessionID(active_session_id); + // restore active session id + LLIMModel::instance().setActiveSessionID(active_session_id); + } } } |