From b83647fb0c3ce721e24b7773bfa557d9fbbaab14 Mon Sep 17 00:00:00 2001
From: Todd Stinson <stinson@lindenlab.com>
Date: Wed, 23 May 2012 15:52:48 -0700
Subject: [PATCH] EXP-1947: Altering notification toasts in the case of a teen
 user.

---
 indra/newview/llviewermessage.cpp             | 21 +++++++++----
 .../skins/default/xui/en/notifications.xml    | 30 +++++++++++++++++--
 2 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index c68e86d7e93..91f0ad86bcd 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5510,13 +5510,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
 	
 	bool returnValue = false;
 	LLNotificationPtr maturityLevelNotification;
+	std::string notifySuffix = "_Notify";
 	if (regionAccess == SIM_ACCESS_MATURE)
 	{
 		if (gAgent.isTeen())
 		{
 			gAgent.clearFailedTeleportRequest();
-			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
+			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
 			returnValue = true;
+
+			notifySuffix = "_NotifyAdultsOnly";
 		}
 		else if (gAgent.prefersPG())
 		{
@@ -5545,8 +5548,10 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
 		if (!gAgent.isAdult())
 		{
 			gAgent.clearFailedTeleportRequest();
-			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
+			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
 			returnValue = true;
+
+			notifySuffix = "_NotifyAdultsOnly";
 		}
 		else if (gAgent.prefersPG() || gAgent.prefersMature())
 		{
@@ -5574,7 +5579,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
 	if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored())
 	{
 		// Given a simple notification if no maturityLevelNotification is set or it is ignore
-		LLNotificationsUtil::add(notificationID+"_Notify", llsdBlock);
+		LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock);
 	}
 
 	return returnValue;
@@ -5621,16 +5626,20 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
 			 
 				RegionEntryAccessBlocked
 				RegionEntryAccessBlocked_Notify
+				RegionEntryAccessBlocked_NotifyAdultsOnly
 				RegionEntryAccessBlocked_Change
-				RegionEntryAccessBlocked_KB
+				RegionEntryAccessBlocked_AdultsOnlyContent
+				RegionEntryAccessBlocked_ChangeAndReTeleport
 				LandClaimAccessBlocked 
 				LandClaimAccessBlocked_Notify 
+				LandClaimAccessBlocked_NotifyAdultsOnly
 				LandClaimAccessBlocked_Change 
-				LandClaimAccessBlocked_KB 
+				LandClaimAccessBlocked_AdultsOnlyContent 
 				LandBuyAccessBlocked
 				LandBuyAccessBlocked_Notify
+				LandBuyAccessBlocked_NotifyAdultsOnly
 				LandBuyAccessBlocked_Change
-				LandBuyAccessBlocked_KB
+				LandBuyAccessBlocked_AdultsOnlyContent
 			 
 			-----------------------------------------------------------------------*/ 
 			if (handle_special_notification(notificationID, llsdBlock))
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 79292af05ca..7b4dc0045fd 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4078,7 +4078,7 @@ Are you sure you want to change the Estate Covenant?
 
   <notification
    icon="alertmodal.tga"
-   name="RegionEntryAccessBlocked_KB"
+   name="RegionEntryAccessBlocked_AdultsOnlyContent"
    type="alertmodal">
    <tag>fail</tag>
     <tag>confirm</tag>
@@ -4101,6 +4101,14 @@ Are you sure you want to change the Estate Covenant?
 The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content.
   </notification>
 
+  <notification
+   icon="notifytip.tga"
+   name="RegionEntryAccessBlocked_NotifyAdultsOnly"
+   type="notifytip">
+    <tag>fail</tag>
+    The region you're trying to visit contains content, which is accessible to adults only.
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="RegionEntryAccessBlocked_ChangeAndReTeleport"
@@ -4189,7 +4197,7 @@ We were unable to change your preferences to view [RATING] content at this time.
 
   <notification
    icon="alertmodal.tga"
-   name="LandClaimAccessBlocked_KB"
+   name="LandClaimAccessBlocked_AdultsOnlyContent"
    type="alertmodal">
     Only adults can claim this land.
     <tag>fail</tag>
@@ -4212,6 +4220,14 @@ We were unable to change your preferences to view [RATING] content at this time.
     <tag>fail</tag>
   </notification>
 
+  <notification
+   icon="notifytip.tga"
+   name="LandClaimAccessBlocked_NotifyAdultsOnly"
+   type="notifytip">
+    <tag>fail</tag>
+    The land you're trying to claim contains content, which is accessible to adults only.
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="LandClaimAccessBlocked_Change"
@@ -4246,7 +4262,7 @@ We were unable to change your preferences to view [RATING] content at this time.
 
   <notification
    icon="alertmodal.tga"
-   name="LandBuyAccessBlocked_KB"
+   name="LandBuyAccessBlocked_AdultsOnlyContent"
    type="alertmodal">
     Only adults can buy this land.
     <tag>confirm</tag>
@@ -4269,6 +4285,14 @@ We were unable to change your preferences to view [RATING] content at this time.
     <tag>fail</tag>
   </notification>
 
+  <notification
+   icon="notifytip.tga"
+   name="LandBuyAccessBlocked_NotifyAdultsOnly"
+   type="notifytip">
+    <tag>fail</tag>
+    The land you're trying to buy contains content, which is accessible to adults only.
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="LandBuyAccessBlocked_Change"
-- 
GitLab