From 09964ec6ede2c9dba5954448bff6b2da2dc179af Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 24 Sep 2013 19:10:43 -0700 Subject: Created an experience specific permissions dialog. --- indra/newview/llviewermessage.cpp | 79 +++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e3335c9cd8..9be5de3433 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -115,6 +115,7 @@ #include #include "llnotificationmanager.h" // +#include "llexperiencecache.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -6354,6 +6355,26 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) if ( response["Mute"] ) // mute { script_question_mute(task_id,notification["payload"]["object_name"].asString()); + } + + if ( response["BlockExperience"] ) + { + if(notification["payload"].has("experience")) + { + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + return false; + + std::string lookup_url=region->getCapability("ExperiencePreferences"); + if(lookup_url.empty()) + return false; + LLSD permission; + LLSD data; + permission["permission"]="Block"; + + data[notification["payload"]["experience"].asString()]=permission; + LLHTTPClient::put(lookup_url, data, NULL); + } } return false; @@ -6388,8 +6409,26 @@ void script_question_mute(const LLUUID& task_id, const std::string& object_name) static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb); static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestionCaution", script_question_cb); +static LLNotificationFunctorRegistration script_question_cb_reg_3("ScriptQuestionExperience", script_question_cb); static LLNotificationFunctorRegistration unknown_script_question_cb_reg("UnknownScriptQuestion", unknown_script_question_cb); + +void process_script_experience_details(const LLSD& experience_details, LLSD args, LLSD payload) +{ + if(experience_details[LLExperienceCache::PROPERTIES].asInteger() & LLExperienceCache::PROPERTY_GRID) + { + args["GRID_WIDE"] = LLTrans::getString("GRID_WIDE")+ " "; + } + else + { + args["GRID_WIDE"] = ""; + } + args["EXPERIENCE"] = LLSLURL("experience", experience_details[LLExperienceCache::EXPERIENCE_ID].asUUID(), "profile").getSLURLString(); + + LLNotificationsUtil::add("ScriptQuestionExperience", args, payload); +} + + void process_script_question(LLMessageSystem *msg, void **user_data) { // *TODO: Translate owner name -> [FIRST] [LAST] @@ -6401,6 +6440,9 @@ void process_script_question(LLMessageSystem *msg, void **user_data) S32 questions; std::string object_name; std::string owner_name; + LLUUID experienceid; + + // taskid -> object key of object requesting permissions msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid ); @@ -6410,6 +6452,11 @@ void process_script_question(LLMessageSystem *msg, void **user_data) msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectOwner, owner_name); msg->getS32Fast(_PREHASH_Data, _PREHASH_Questions, questions ); + if(msg->has(_PREHASH_Experience)) + { + msg->getUUIDFast(_PREHASH_Experience, _PREHASH_ExperienceID, experienceid); + } + // Special case. If the objects are owned by this agent, throttle per-object instead // of per-owner. It's common for residents to reset a ton of scripts that re-request // permissions, as with tier boxes. UUIDs can't be valid agent names and vice-versa, @@ -6495,26 +6542,28 @@ void process_script_question(LLMessageSystem *msg, void **user_data) payload["object_name"] = object_name; payload["owner_name"] = owner_name; - // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) - { - if (caution) - { - args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; - } - // display the caution permissions prompt - LLNotificationsUtil::add(caution ? "ScriptQuestionCaution" : "ScriptQuestion", args, payload); - } - else - { - // fall back to default behavior if cautions are entirely disabled - LLNotificationsUtil::add("ScriptQuestion", args, payload); - } + + const char* notification = "ScriptQuestion"; + + if(caution && gSavedSettings.getBOOL("PermissionsCautionEnabled")) + { + args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; + notification = "ScriptQuestionCaution"; + } + else if(experienceid.notNull()) + { + payload["experience"]=experienceid; + LLExperienceCache::get(experienceid, boost::bind(process_script_experience_details, _1, args, payload)); + return; + } + + LLNotificationsUtil::add(notification, args, payload); } } } + void process_derez_container(LLMessageSystem *msg, void**) { LL_WARNS("Messaging") << "call to deprecated process_derez_container" << LL_ENDL; -- cgit v1.2.3 From 309ffd57fade231c3d14eedfe1171788e250f088 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 22 Oct 2013 10:51:53 -0700 Subject: Post events on experience permission changes to refresh uis --- indra/newview/llviewermessage.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d7dffc5016..47644d2c6f 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6343,6 +6343,12 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) return false; } + LLUUID experience; + if(notification["payload"].has("experience")) + { + experience = notification["payload"]["experience"].asUUID(); + } + // check whether permissions were granted or denied BOOL allowed = TRUE; // the "yes/accept" button is the first button in the template, making it button 0 @@ -6351,7 +6357,17 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) { new_questions = 0; allowed = FALSE; - } + } + else if(experience.notNull()) + { + LLSD permission; + LLSD data; + permission["permission"]="Allow"; + + data[experience.asString()]=permission; + data["experience"]=experience; + LLEventPumps::instance().obtain("experience_permission").post(data); + } LLUUID task_id = notification["payload"]["task_id"].asUUID(); LLUUID item_id = notification["payload"]["item_id"].asUUID(); @@ -6381,7 +6397,7 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) if ( response["BlockExperience"] ) { - if(notification["payload"].has("experience")) + if(experience.notNull()) { LLViewerRegion* region = gAgent.getRegion(); if (!region) @@ -6394,8 +6410,11 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) LLSD data; permission["permission"]="Block"; - data[notification["payload"]["experience"].asString()]=permission; + data[experience.asString()]=permission; LLHTTPClient::put(lookup_url, data, NULL); + + data["experience"]=experience; + LLEventPumps::instance().obtain("experience_permission").post(data); } } -- cgit v1.2.3 From b932dbd1193f911691e918f6bee96da88b3c71e5 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 5 Dec 2013 10:47:44 -0800 Subject: Added notification for experience declined due to maturity --- indra/newview/llviewermessage.cpp | 119 ++++++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 43 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 895400fc89..d7ec4e0ead 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5882,39 +5882,38 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock) return returnValue; } -bool attempt_standard_notification(LLMessageSystem* msgsystem) +bool handle_home_position_set(std::string notificationID, LLSD& llsdBlock) { - // if we have additional alert data - if (msgsystem->has(_PREHASH_AlertInfo) && msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0) - { - // notification was specified using the new mechanism, so we can just handle it here - std::string notificationID; - msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); - if (!LLNotifications::getInstance()->templateExists(notificationID)) - { - return false; - } + std::string snap_filename = gDirUtilp->getLindenUserDir(); + snap_filename += gDirUtilp->getDirDelimiter(); + snap_filename += SCREEN_HOME_FILENAME; + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); - std::string llsdRaw; - LLSD llsdBlock; - msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); - msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_ExtraParams, llsdRaw); - if (llsdRaw.length()) - { - std::istringstream llsdData(llsdRaw); - if (!LLSDSerialize::deserialize(llsdBlock, llsdData, llsdRaw.length())) - { - llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl; - } - } - - if ( - (notificationID == "RegionEntryAccessBlocked") || - (notificationID == "LandClaimAccessBlocked") || - (notificationID == "LandBuyAccessBlocked") - ) - { - /*--------------------------------------------------------------------- + return false; +} + +bool handle_experience_maturity_exceeded(std::string notificationID, LLSD& llsdBlock) +{ + if(llsdBlock.has("experience_id")) + { + llsdBlock["EXPERIENCE_SLURL"]=LLSLURL("experience", llsdBlock["experience_id"].asUUID(), "profile").getSLURLString(); + } + return false; +} + +typedef boost::function standard_exception_function_t; +typedef std::map standard_exception_map_t; + +standard_exception_map_t sStandardExceptions; + +bool process_exceptions(std::string notificationID, LLSD& llsdBlock) +{ + if(sStandardExceptions.empty()) + { + sStandardExceptions["RegionEntryAccessBlocked"] = handle_special_notification; + sStandardExceptions["LandClaimAccessBlocked"] = handle_special_notification; + sStandardExceptions["LandBuyAccessBlocked"] = handle_special_notification; + /*--------------------------------------------------------------------- (Commented so a grep will find the notification strings, since we construct them on the fly; if you add additional notifications, please update the comment.) @@ -5939,21 +5938,55 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LandBuyAccessBlocked_AdultsOnlyContent -----------------------------------------------------------------------*/ - if (handle_special_notification(notificationID, llsdBlock)) - { - return true; - } + + + sStandardExceptions["HomePositionSet"] = handle_home_position_set; + sStandardExceptions["ExperienceMaturityExceeded"] = handle_experience_maturity_exceeded; + } + + standard_exception_map_t::iterator it = sStandardExceptions.find(notificationID); + + if(it == sStandardExceptions.end()) + { + return false; + } + + return it->second(notificationID, llsdBlock); +} + + + +bool attempt_standard_notification(LLMessageSystem* msgsystem) +{ + // if we have additional alert data + if (msgsystem->has(_PREHASH_AlertInfo) && msgsystem->getNumberOfBlocksFast(_PREHASH_AlertInfo) > 0) + { + // notification was specified using the new mechanism, so we can just handle it here + std::string notificationID; + msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + if (!LLNotifications::getInstance()->templateExists(notificationID)) + { + return false; } - // HACK -- handle callbacks for specific alerts. - if( notificationID == "HomePositionSet" ) + + std::string llsdRaw; + LLSD llsdBlock; + msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_ExtraParams, llsdRaw); + if (llsdRaw.length()) { - // save the home location image to disk - std::string snap_filename = gDirUtilp->getLindenUserDir(); - snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + std::istringstream llsdData(llsdRaw); + if (!LLSDSerialize::deserialize(llsdBlock, llsdData, llsdRaw.length())) + { + llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl; + } } - + + if(process_exceptions(notificationID, llsdBlock)) + { + return true; + } + LLNotificationsUtil::add(notificationID, llsdBlock); return true; } -- cgit v1.2.3 From 8b690a3fdfb24aea23150031768e0734043195aa Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 11 Feb 2014 15:25:00 -0800 Subject: Updated message for TeleportedHomeExperienceRemoved --- indra/newview/llviewermessage.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d7ec4e0ead..74b9ea466b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5941,7 +5941,6 @@ bool process_exceptions(std::string notificationID, LLSD& llsdBlock) sStandardExceptions["HomePositionSet"] = handle_home_position_set; - sStandardExceptions["ExperienceMaturityExceeded"] = handle_experience_maturity_exceeded; } standard_exception_map_t::iterator it = sStandardExceptions.find(notificationID); -- cgit v1.2.3 From 80fcd6d9d42377fc09928eb99f26e6287c4b544d Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 24 Apr 2014 14:00:15 -0700 Subject: If an agent fails to teleport into a region with trusted experiences and they pass all other checks then a list of experiences will be presented to them. --- indra/newview/llviewermessage.cpp | 122 ++++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 52 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c7d3fe948d..118fba94e0 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5797,84 +5797,102 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) // some of the server notifications need special handling. This is where we do that. bool handle_teleport_access_blocked(LLSD& llsdBlock) { - std::string notificationID("TeleportEntryAccessBlocked"); - U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); - std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); - LLStringUtil::toLower(regionMaturity); - llsdBlock["REGIONMATURITY"] = regionMaturity; - bool returnValue = false; - LLNotificationPtr maturityLevelNotification; - std::string notifySuffix = "_Notify"; - if (regionAccess == SIM_ACCESS_MATURE) + if(llsdBlock.has("_region_access")) { - if (gAgent.isTeen()) - { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); - returnValue = true; - - notifySuffix = "_NotifyAdultsOnly"; - } - else if (gAgent.prefersPG()) + std::string notificationID("TeleportEntryAccessBlocked"); + U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); + std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); + LLStringUtil::toLower(regionMaturity); + llsdBlock["REGIONMATURITY"] = regionMaturity; + + LLNotificationPtr maturityLevelNotification; + std::string notifySuffix = "_Notify"; + if (regionAccess == SIM_ACCESS_MATURE) { - if (gAgent.hasRestartableFailedTeleportRequest()) + if (gAgent.isTeen()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG()) + { + if (gAgent.hasRestartableFailedTeleportRequest()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } else { gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } } - else + else if (regionAccess == SIM_ACCESS_ADULT) { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - returnValue = true; - } - } - else if (regionAccess == SIM_ACCESS_ADULT) - { - if (!gAgent.isAdult()) - { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); - returnValue = true; - - notifySuffix = "_NotifyAdultsOnly"; - } - else if (gAgent.prefersPG() || gAgent.prefersMature()) - { - if (gAgent.hasRestartableFailedTeleportRequest()) + if (!gAgent.isAdult()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG() || gAgent.prefersMature()) + { + if (gAgent.hasRestartableFailedTeleportRequest()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback); + returnValue = true; + } + else + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } } else { gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); returnValue = true; } + } + + if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) + { + // Given a simple notification if no maturityLevelNotification is set or it is ignore + LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } - else + } + if(llsdBlock.has("trusted_experiences")) + { + std::ostringstream str; + const LLSD& experiences = llsdBlock["trusted_experiences"]; + LLSD::array_const_iterator it = experiences.beginArray(); + for(/**/; it != experiences.endArray(); ++it) { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - returnValue = true; + str<asUUID(), "profile").getSLURLString() << "\n"; } + std::string str_list = str.str(); + if(!str_list.empty()) + { + LLNotificationsUtil::add("TrustedExperiencesAvailable", LLSD::emptyMap().with("EXPERIENCE_LIST", (LLSD)str_list)); + returnValue = true; } - - if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) - { - // Given a simple notification if no maturityLevelNotification is set or it is ignore - LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } - return returnValue; } -- cgit v1.2.3 From 38da22d3470286840d08fcdfb7b9462e10cca8e0 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 1 May 2014 14:08:59 -0700 Subject: added handle_trusted_experiences_notification --- indra/newview/llviewermessage.cpp | 130 +++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 57 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 118fba94e0..cdb228f084 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -124,6 +124,8 @@ #pragma warning (disable:4702) #endif + + extern void on_new_message(const LLSD& msg); // @@ -146,6 +148,7 @@ extern bool gShiftFrame; bool check_offer_throttle(const std::string& from_name, bool check_only); bool check_asset_previewable(const LLAssetType::EType asset_type); static void process_money_balance_reply_extended(LLMessageSystem* msg); +bool handle_trusted_experiences_notification(const LLSD&); //inventory offer throttle globals LLFrameTimer gThrottleTimer; @@ -5735,63 +5738,87 @@ bool handle_prompt_for_maturity_level_change_and_reteleport_callback(const LLSD& // some of the server notifications need special handling. This is where we do that. bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) { - U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); - std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); - LLStringUtil::toLower(regionMaturity); - llsdBlock["REGIONMATURITY"] = regionMaturity; bool returnValue = false; - LLNotificationPtr maturityLevelNotification; - std::string notifySuffix = "_Notify"; - if (regionAccess == SIM_ACCESS_MATURE) + if(llsdBlock.has("_region_access")) { - if (gAgent.isTeen()) + U8 regionAccess = static_cast(llsdBlock["_region_access"].asInteger()); + std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); + LLStringUtil::toLower(regionMaturity); + llsdBlock["REGIONMATURITY"] = regionMaturity; + LLNotificationPtr maturityLevelNotification; + std::string notifySuffix = "_Notify"; + if (regionAccess == SIM_ACCESS_MATURE) { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); - returnValue = true; + if (gAgent.isTeen()) + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); + returnValue = true; - notifySuffix = "_NotifyAdultsOnly"; + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); + returnValue = true; + } } - else if (gAgent.prefersPG()) + else if (regionAccess == SIM_ACCESS_ADULT) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - returnValue = true; + if (!gAgent.isAdult()) + { + gAgent.clearTeleportRequest(); + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); + returnValue = true; + + notifySuffix = "_NotifyAdultsOnly"; + } + else if (gAgent.prefersPG() || gAgent.prefersMature()) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); + returnValue = true; + } + else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + { + maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); + returnValue = true; + } } - else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + + if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); - returnValue = true; + // Given a simple notification if no maturityLevelNotification is set or it is ignore + LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } } - else if (regionAccess == SIM_ACCESS_ADULT) - { - if (!gAgent.isAdult()) - { - gAgent.clearTeleportRequest(); - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock); - returnValue = true; - notifySuffix = "_NotifyAdultsOnly"; - } - else if (gAgent.prefersPG() || gAgent.prefersMature()) + return returnValue; +} + +bool handle_trusted_experiences_notification(const LLSD& llsdBlock) +{ + if(llsdBlock.has("trusted_experiences")) + { + std::ostringstream str; + const LLSD& experiences = llsdBlock["trusted_experiences"]; + LLSD::array_const_iterator it = experiences.beginArray(); + for(/**/; it != experiences.endArray(); ++it) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback); - returnValue = true; + str<asUUID(), "profile").getSLURLString() << "\n"; } - else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) + std::string str_list = str.str(); + if(!str_list.empty()) { - maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock); - returnValue = true; + LLNotificationsUtil::add("TrustedExperiencesAvailable", LLSD::emptyMap().with("EXPERIENCE_LIST", (LLSD)str_list)); + return true; } } - - if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored()) - { - // Given a simple notification if no maturityLevelNotification is set or it is ignore - LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); - } - - return returnValue; + return false; } // some of the server notifications need special handling. This is where we do that. @@ -5877,22 +5904,7 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock) LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock); } } - if(llsdBlock.has("trusted_experiences")) - { - std::ostringstream str; - const LLSD& experiences = llsdBlock["trusted_experiences"]; - LLSD::array_const_iterator it = experiences.beginArray(); - for(/**/; it != experiences.endArray(); ++it) - { - str<asUUID(), "profile").getSLURLString() << "\n"; - } - std::string str_list = str.str(); - if(!str_list.empty()) - { - LLNotificationsUtil::add("TrustedExperiencesAvailable", LLSD::emptyMap().with("EXPERIENCE_LIST", (LLSD)str_list)); - returnValue = true; - } - } + return returnValue; } @@ -5921,6 +5933,9 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl; } } + + + handle_trusted_experiences_notification(llsdBlock); if ( (notificationID == "RegionEntryAccessBlocked") || @@ -6004,6 +6019,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } LLNotificationsUtil::add(notificationID, llsdBlock); + return true; } return false; -- cgit v1.2.3 From 9a7458f9e32773c07b689a6d490e5bfe9c6ec47f Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 15 May 2014 11:56:46 -0700 Subject: Check for trusted experiences on teleport denied (again) --- indra/newview/llviewermessage.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 266ad220e2..d4750c0689 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5796,6 +5796,7 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock) } } + handle_trusted_experiences_notification(llsdBlock); return returnValue; } -- cgit v1.2.3 From 8cc8e7dc77c7aff6d4698632d6a3bebe76698ff7 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 28 Oct 2014 11:43:45 -0700 Subject: ACME-1601: Updated message to match behavior ACME-1616: Change references of "Grid-Wide" to "Grid-Scope" and "non Grid-Wide" to "Land-Scope" --- indra/newview/llviewermessage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a0b7e78369..d99d2b2990 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6491,11 +6491,11 @@ void process_script_experience_details(const LLSD& experience_details, LLSD args { if(experience_details[LLExperienceCache::PROPERTIES].asInteger() & LLExperienceCache::PROPERTY_GRID) { - args["GRID_WIDE"] = LLTrans::getString("GRID_WIDE")+ " "; + args["GRID_WIDE"] = LLTrans::getString("Grid-Scope"); } else { - args["GRID_WIDE"] = ""; + args["GRID_WIDE"] = LLTrans::getString("Land-Scope"); } args["EXPERIENCE"] = LLSLURL("experience", experience_details[LLExperienceCache::EXPERIENCE_ID].asUUID(), "profile").getSLURLString(); -- cgit v1.2.3