From 2720449daa4b07188fd9a2f24246817f963c6d5c Mon Sep 17 00:00:00 2001
From: Todd Stinson <stinson@lindenlab.com>
Date: Mon, 21 May 2012 12:26:45 -0700
Subject: EXP-1928: Restoring the flow for non-teleport-failure messages
 through the special notification handler.

---
 indra/newview/llviewermessage.cpp                    | 14 ++++++++++----
 indra/newview/skins/default/xui/en/notifications.xml |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3c2949d9ee..be3357041a 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5514,19 +5514,22 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
 	{
 		if (gAgent.isTeen())
 		{
+			gAgent.clearFailedTeleportRequest();
 			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
 			returnValue = true;
 		}
 		else if (gAgent.prefersPG())
 		{
-			if (gAgent.hasRestartableFailedTeleportRequest())
+			if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) &&
+				gAgent.hasRestartableFailedTeleportRequest())
 			{
 				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
 				returnValue = true;
 			}
 			else
 			{
-				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+				gAgent.clearFailedTeleportRequest();
+				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
 				returnValue = true;
 			}
 		}
@@ -5535,19 +5538,22 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
 	{
 		if (!gAgent.isAdult())
 		{
+			gAgent.clearFailedTeleportRequest();
 			maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_KB", llsdBlock);
 			returnValue = true;
 		}
 		else if (gAgent.prefersPG() || gAgent.prefersMature())
 		{
-			if (gAgent.hasRestartableFailedTeleportRequest())
+			if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) &&
+				gAgent.hasRestartableFailedTeleportRequest())
 			{
 				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
 				returnValue = true;
 			}
 			else
 			{
-				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeOnly", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+				gAgent.clearFailedTeleportRequest();
+				maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
 				returnValue = true;
 			}
 		}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index fd153aba1f..d1777371ef 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4128,7 +4128,7 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
 
   <notification
    icon="alertmodal.tga"
-   name="RegionEntryAccessBlocked_ChangeOnly"
+   name="RegionEntryAccessBlocked_Change"
    type="alertmodal">
     <tag>fail</tag>
     <tag>confirm</tag>
-- 
cgit v1.2.3