From 4a85090d8fb9490d9056cdd32ff191cd0e1ecaac Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 12 Jul 2013 18:50:19 +0200 Subject: [PATCH] Properly pass-through is_announcement parameter for incoming IMs again --- indra/newview/llimview.cpp | 19 ++++++++++++++----- indra/newview/llimview.h | 12 ++++++++---- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cbc4e95708..8f79b09ce5 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1097,6 +1097,8 @@ void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id) mNoUnreadMsgsSignal(arg); } +// Added is_announcement parameter +//bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, BOOL is_announcement /* = FALSE */) { LLIMSession* session = findIMSession(session_id); @@ -1107,7 +1109,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, return false; } - // Forward IM to nearby chat if wanted + // Forward IM to nearby chat if wanted std::string timestr = LLLogChat::timestamp(false); session->addMessage(from, from_id, utf8_text, timestr); //might want to add date separately @@ -1144,7 +1146,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, // [FS communication UI] nearby_chat->addMessage(chat, true, LLSD()); } - // + // return true; } @@ -1218,6 +1220,9 @@ bool LLIMModel::proccessOnlineOfflineNotification( return addMessage(session_id, SYSTEM_FROM, LLUUID::null, utf8_text); } +// Added is_announcement parameter +//bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, +// const std::string& utf8_text, bool log2file /* = true */) { bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool log2file /* = true */, BOOL is_announcement /* = FALSE */) { @@ -1246,6 +1251,9 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co return true; } +// Added is_announcement parameter +//LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, +// const std::string& utf8_text, bool log2file /* = true */) LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool log2file /* = true */, BOOL is_announcement /* = FALSE */) { @@ -2890,7 +2898,7 @@ void LLIMMgr::addMessage( const LLUUID& region_id, const LLVector3& position, bool link_name, // If this is true, then we insert the name and link it to a profile - BOOL is_announcement) // Ansariel: Special parameter indicating announcements + BOOL is_announcement) // Special parameter indicating announcements { LLUUID other_participant_id = target_id; @@ -3038,8 +3046,9 @@ void LLIMMgr::addMessage( if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message) { - //LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg, true, is_announcement); CHUI Merge this got clobbered above - LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); + // Added is_announcement parameter + //LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); + LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg, true, is_announcement); } // Open conversation floater if offline messages are present diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index fad993f1eb..3a4b85128b 100755 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -225,13 +225,16 @@ public: * and also saved into a file if log2file is specified. * It sends new message signal for each added message. */ - // Ansariel: Added is_announcement parameter + // Added is_announcement parameter + //bool addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true); bool addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true, BOOL is_announcement = FALSE); /** * Similar to addMessage(...) above but won't send a signal about a new message added */ - // Ansariel: Added is_announcement parameter + // Added is_announcement parameter + //LLIMModel::LLIMSession* addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, + // const std::string& utf8_text, bool log2file = true); LLIMModel::LLIMSession* addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool log2file = true, BOOL is_announcement = FALSE); @@ -320,7 +323,8 @@ private: /** * Add message to a list of message associated with session specified by session_id */ - // Ansariel: Added is_announcement parameter + // Added is_announcement parameter + //bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, BOOL is_announcement = FALSE); }; @@ -364,7 +368,7 @@ public: const LLUUID& region_id = LLUUID::null, const LLVector3& position = LLVector3::zero, bool link_name = false, - BOOL is_announcement = FALSE // Ansariel: Special parameter indicating announcement + BOOL is_announcement = FALSE // Special parameter indicating announcement ); void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args);