summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-17 17:12:00 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-17 17:12:00 -0700
commit90c6b871c49e5936639cfc181d6119fc1a8a3f08 (patch)
tree23870b5d5f840aebd7af9e72bd143e6a50601d53 /indra/newview/llviewermessage.cpp
parentcf0a6a61bd44b4becfa81eb3e0c6b16bc42c4c44 (diff)
EXP-1928: Constructing the new maturity preferences flow for the case of a teleport via lure (which cannot be restared).
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp45
1 files changed, 38 insertions, 7 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a2054c1244..f84ada18ab 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5387,7 +5387,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
}
}
-void handle_maturity_preference_change(const LLSD &pResponse, U8 pMaturityRatingChange)
+void handle_maturity_preference_change_and_reteleport(const LLSD &pResponse, U8 pMaturityRatingChange)
{
bool isMaturityPreferenceElevated = false;
U8 actualPrefValue = SIM_ACCESS_MIN;
@@ -5485,7 +5485,7 @@ void handle_maturity_preference_change(const LLSD &pResponse, U8 pMaturityRating
}
}
-bool handle_special_notification_callback(const LLSD& notification, const LLSD& response)
+bool handle_prompt_for_maturity_level_change_callback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -5494,7 +5494,22 @@ bool handle_special_notification_callback(const LLSD& notification, const LLSD&
// set the preference to the maturity of the region we're calling
U8 preferredMaturity = static_cast<U8>(notification["payload"]["_region_access"].asInteger());
gSavedSettings.setU32("PreferredMaturity", static_cast<U32>(preferredMaturity));
- gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change, _1, preferredMaturity));
+ gAgent.sendMaturityPreferenceToServer(preferredMaturity);
+ }
+
+ return false;
+}
+
+bool handle_prompt_for_maturity_level_change_and_reteleport_callback(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+ if (0 == option)
+ {
+ // set the preference to the maturity of the region we're calling
+ U8 preferredMaturity = static_cast<U8>(notification["payload"]["_region_access"].asInteger());
+ gSavedSettings.setU32("PreferredMaturity", static_cast<U32>(preferredMaturity));
+ gAgent.sendMaturityPreferenceToServer(preferredMaturity, boost::bind(&handle_maturity_preference_change_and_reteleport, _1, preferredMaturity));
}
else
{
@@ -5523,8 +5538,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
else if (gAgent.prefersPG())
{
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
- returnValue = true;
+ if (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);
+ returnValue = true;
+ }
}
}
else if (regionAccess == SIM_ACCESS_ADULT)
@@ -5536,8 +5559,16 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
else if (gAgent.prefersPG() || gAgent.prefersMature())
{
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_special_notification_callback);
- returnValue = true;
+ if (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);
+ returnValue = true;
+ }
}
}