diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-05-17 11:38:39 -0700 | 
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-05-17 11:38:39 -0700 | 
| commit | 8f930cf296230306ae59574945106d7fd67826a1 (patch) | |
| tree | eaa6636e8315f364333c3df49eb3712a8b4b7ab0 | |
| parent | 6809b5068ffd0e0daece06af5dad56c32dfe2966 (diff) | |
EXP-1928: Adding functionality to show either a modal notification dialog or the toast-style notification if a teleport fails due to maturity preferences.
| -rwxr-xr-x | indra/newview/llviewermessage.cpp | 30 | 
1 files changed, 18 insertions, 12 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 56522bc819..d88a6f1a9b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5424,36 +5424,42 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)  	int regionAccess = llsdBlock["_region_access"].asInteger();  	llsdBlock["REGIONMATURITY"] = LLViewerRegion::accessToString(regionAccess); -	// we're going to throw the LLSD in there in case anyone ever wants to use it -	LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); -	 +	bool returnValue = false; +	LLNotificationPtr maturityLevelNotification;  	if (regionAccess == SIM_ACCESS_MATURE)  	{  		if (gAgent.isTeen())  		{ -			LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); -			return true; +			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); +			returnValue = true;  		}  		else if (gAgent.prefersPG())  		{ -			LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); -			return true; +			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); +			returnValue = true;  		}  	}  	else if (regionAccess == SIM_ACCESS_ADULT)  	{  		if (!gAgent.isAdult())  		{ -			LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); -			return true; +			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock); +			returnValue = true;  		}  		else if (gAgent.prefersPG() || gAgent.prefersMature())  		{ -			LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); -			return true; +			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback); +			returnValue = true;  		}  	} -	return false; + +	if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) +	{ +		// Given a simple notification if no maturityLevelNotification is set or it is ignore +		LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock); +	} + +	return returnValue;  }  bool attempt_standard_notification(LLMessageSystem* msgsystem)  | 
