diff options
| -rw-r--r-- | indra/llui/llchat.h | 3 | ||||
| -rw-r--r-- | indra/newview/llchathistory.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llfloaterimsession.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llimprocessing.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llimview.cpp | 21 | ||||
| -rw-r--r-- | indra/newview/llimview.h | 10 | 
6 files changed, 38 insertions, 20 deletions
diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index c39e44200c..b4fd5f60aa 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -38,7 +38,8 @@ typedef enum e_chat_source_type  	CHAT_SOURCE_AGENT = 1,  	CHAT_SOURCE_OBJECT = 2,  	CHAT_SOURCE_TELEPORT = 3, -	CHAT_SOURCE_UNKNOWN = 4 +	CHAT_SOURCE_UNKNOWN = 4, +	CHAT_SOURCE_REGION = 5,  } EChatSourceType;  typedef enum e_chat_type diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index bdd516e1de..79b7372610 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -602,7 +602,7 @@ public:  	void showInspector()  	{ -		if (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType) return; +		if (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType && CHAT_SOURCE_REGION != mSourceType) return;  		if (mSourceType == CHAT_SOURCE_OBJECT)  		{ @@ -744,6 +744,7 @@ public:  				icon->setValue(LLSD("OBJECT_Icon"));  				break;  			case CHAT_SOURCE_SYSTEM: +			case CHAT_SOURCE_REGION:  				icon->setValue(LLSD("SL_Logo"));  				break;  			case CHAT_SOURCE_TELEPORT: @@ -893,7 +894,7 @@ protected:  	void showInfoCtrl()  	{ -		const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; +		const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType && CHAT_SOURCE_REGION != mSourceType;  		if (isVisible)  		{  			const LLRect sticky_rect = mUserNameTextBox->getRect(); @@ -1286,7 +1287,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL  				mEditor->appendText(chat.mFromName + delimiter, prependNewLineState, link_params);  				prependNewLineState = false;  			} -			else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) +			else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log && chat.mSourceType != CHAT_SOURCE_REGION)  			{  				LLStyle::Params link_params(body_message_params);  				link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 48e2b8dc14..ee9dc35283 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -842,6 +842,7 @@ void LLFloaterIMSession::updateMessages()  			std::string from = msg["from"].asString();  			std::string message = msg["message"].asString();  			bool is_history = msg["is_history"].asBoolean(); +			bool is_region_msg = msg["is_region_msg"].asBoolean();  			LLChat chat;  			chat.mFromID = from_id; @@ -849,6 +850,10 @@ void LLFloaterIMSession::updateMessages()  			chat.mFromName = from;  			chat.mTimeStr = time;  			chat.mChatStyle = is_history ? CHAT_STYLE_HISTORY : chat.mChatStyle; +            if (is_region_msg) +            { +                chat.mSourceType = CHAT_SOURCE_REGION; +            }  			// process offer notification  			if (msg.has("notification_id")) diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 0524313a5c..d29e0314b4 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -55,6 +55,7 @@  #include "llviewerwindow.h"  #include "llviewerregion.h"  #include "llvoavatarself.h" +#include "llworld.h"  #include "boost/lexical_cast.hpp"  #if LL_MSVC @@ -572,6 +573,15 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,                  }                  if (!mute_im)                  { +                    bool region_message = false; +                    if (region_id.isNull()) +                    { +                        LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(from_id); +                        if (regionp) +                        { +                            region_message = true; +                        } +                    }                      gIMMgr->addMessage(                          session_id,                          from_id, @@ -583,7 +593,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,                          parent_estate_id,                          region_id,                          position, -                        true); +                        region_message);                  }                  else                  { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b7e0a6a794..c3131a513a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -771,7 +771,7 @@ void LLIMModel::LLIMSession::sessionInitReplyReceived(const LLUUID& new_session_  	}  } -void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time, const bool is_history) +void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time, const bool is_history, bool is_region_msg)  {  	LLSD message;  	message["from"] = from; @@ -780,6 +780,7 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f  	message["time"] = time;   	message["index"] = (LLSD::Integer)mMsgs.size();   	message["is_history"] = is_history; +	message["is_region_msg"] = is_region_msg;  	mMsgs.push_front(message);  @@ -1148,7 +1149,7 @@ void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id)  	mNoUnreadMsgsSignal(arg);  } -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_region_msg) {  	LLIMSession* session = findIMSession(session_id); @@ -1158,7 +1159,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from,  		return false;  	} -	session->addMessage(from, from_id, utf8_text, LLLogChat::timestamp(false)); //might want to add date separately +	session->addMessage(from, from_id, utf8_text, LLLogChat::timestamp(false), false, is_region_msg); //might want to add date separately  	return true;  } @@ -1196,9 +1197,9 @@ bool LLIMModel::proccessOnlineOfflineNotification(  }  bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id,  -						   const std::string& utf8_text, bool log2file /* = true */) {  +						   const std::string& utf8_text, bool log2file, bool is_region_msg) {  -	LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file); +	LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file, is_region_msg);  	if (!session) return false;  	//good place to add some1 to recent list @@ -1223,7 +1224,7 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co  }  LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id,  -													 const std::string& utf8_text, bool log2file /* = true */) +													 const std::string& utf8_text, bool log2file, bool is_region_msg)  {  	LLIMSession* session = findIMSession(session_id); @@ -1239,7 +1240,7 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id,  		from_name = SYSTEM_FROM;  	} -	addToHistory(session_id, from_name, from_id, utf8_text); +	addToHistory(session_id, from_name, from_id, utf8_text, is_region_msg);  	if (log2file)  	{  		logToFile(getHistoryFileName(session_id), from_name, from_id, utf8_text); @@ -2695,7 +2696,7 @@ void LLIMMgr::addMessage(  	U32 parent_estate_id,  	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_region_msg)  {  	LLUUID other_participant_id = target_id; @@ -2767,7 +2768,7 @@ void LLIMMgr::addMessage(  				//<< "*** region_id: " << region_id << std::endl  				//<< "*** position: " << position << std::endl; -				LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str()); +				LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str(), true, is_region_msg);  			}  			// Logically it would make more sense to reject the session sooner, in another area of the @@ -2797,7 +2798,7 @@ 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); +		LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg, true, is_region_msg);  	}  	// Open conversation floater if offline messages are present diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 79c831ebb6..707c8ef79f 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -82,7 +82,7 @@ public:  		void sessionInitReplyReceived(const LLUUID& new_session_id);  		void addMessagesFromHistory(const std::list<LLSD>& history); -		void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time, const bool is_history = false); +		void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time, const bool is_history = false, bool is_region_msg = false);  		void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction);  		/** @deprecated */ @@ -212,13 +212,13 @@ public:  	 * and also saved into a file if log2file is specified.  	 * It sends new message signal for each added message.  	 */ -	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_region_msg = false);  	/**  	 * Similar to addMessage(...) above but won't send a signal about a new message added  	 */  	LLIMModel::LLIMSession* addMessageSilently(const LLUUID& session_id, const std::string& from, const LLUUID& from_id,  -		const std::string& utf8_text, bool log2file = true); +		const std::string& utf8_text, bool log2file = true, bool is_region_msg = false);  	/**  	 * Add a system message to an IM Model @@ -296,7 +296,7 @@ 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); +	bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text, bool is_region_msg = false);  }; @@ -338,7 +338,7 @@ public:  					U32 parent_estate_id = 0,  					const LLUUID& region_id = LLUUID::null,  					const LLVector3& position = LLVector3::zero, -					bool link_name = false); +					bool is_region_msg = false);  	void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args);  | 
