diff options
author | Oz Linden <oz@lindenlab.com> | 2013-05-07 13:38:39 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-05-07 13:38:39 -0400 |
commit | f382233fbb29bf81fc4009930dc134253d8ea250 (patch) | |
tree | 3cd29e1be8193941f582998bb72a100ea5fc6d6c /indra | |
parent | f864a0b562855efc2539fffdb399863b882acb06 (diff) | |
parent | e921e51c18ca2a6f51a2871982629f23557ee262 (diff) |
merge changes for DRTVWR-315
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/lscript/lscript_byteformat.h | 8 | ||||
-rwxr-xr-x | indra/newview/app_settings/keywords.ini | 3 | ||||
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 135 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 24 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/strings.xml | 8 |
5 files changed, 130 insertions, 48 deletions
diff --git a/indra/lscript/lscript_byteformat.h b/indra/lscript/lscript_byteformat.h index a294def734..54031aaf05 100755 --- a/indra/lscript/lscript_byteformat.h +++ b/indra/lscript/lscript_byteformat.h @@ -530,6 +530,10 @@ typedef enum e_lscript_runtime_permissions SCRIPT_PERMISSION_TRACK_CAMERA, SCRIPT_PERMISSION_CONTROL_CAMERA, SCRIPT_PERMISSION_TELEPORT, + SCRIPT_PERMISSION_EXPERIENCE, + SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT, + SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, + SCRIPT_PERMISSION_RETURN_OBJECTS, SCRIPT_PERMISSION_EOF } LSCRIPTRunTimePermissions; @@ -547,6 +551,10 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] = (0x1 << 10),// SCRIPT_PERMISSION_TRACK_CAMERA (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA (0x1 << 12),// SCRIPT_PERMISSION_TELEPORT + (0x1 << 13),// SCRIPT_PERMISSION_EXPERIENCE, + (0x1 << 14),// SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT, + (0x1 << 15),// SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS, + (0x1 << 16),// SCRIPT_PERMISSION_RETURN_OBJECTS, }; // http_request string constants diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 6120f22ba4..f0d8b77afd 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -92,6 +92,9 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent +PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c0d6189ac..ace16396db 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -163,7 +163,11 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = "ChangePermissions", "TrackYourCamera", "ControlYourCamera", - "TeleportYourAgent" + "TeleportYourAgent", + "JoinAnExperience", + "SilentlyManageEstateAccess", + "OverrideYourAnimations", + "ScriptReturnObjects" }; const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = @@ -179,7 +183,11 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE, // ChangePermissions FALSE, // TrackYourCamera, FALSE, // ControlYourCamera - FALSE // TeleportYourAgent + FALSE, // TeleportYourAgent + FALSE, // JoinAnExperience + FALSE, // SilentlyManageEstateAccess + FALSE, // OverrideYourAnimations + FALSE, // ScriptReturnObjects }; bool friendship_offer_callback(const LLSD& notification, const LLSD& response) @@ -6282,6 +6290,19 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp } } +void script_question_mute(const LLUUID& item_id, const std::string& object_name); + +bool unknown_script_question_cb(const LLSD& notification, const LLSD& response) +{ + // Only care if they muted the object here. + if ( response["Mute"] ) // mute + { + LLUUID task_id = notification["payload"]["task_id"].asUUID(); + script_question_mute(task_id,notification["payload"]["object_name"].asString()); + } + return false; +} + bool script_question_cb(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -6332,34 +6353,42 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) if ( response["Mute"] ) // mute { - LLMuteList::getInstance()->add(LLMute(item_id, notification["payload"]["object_name"].asString(), LLMute::OBJECT)); - - // purge the message queue of any previously queued requests from the same source. DEV-4879 - class OfferMatcher : public LLNotificationsUI::LLScreenChannel::Matcher - { - public: - OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} - bool matches(const LLNotificationPtr notification) const - { - if (notification->getName() == "ScriptQuestionCaution" - || notification->getName() == "ScriptQuestion") - { - return (notification->getPayload()["item_id"].asUUID() == blocked_id); - } - return false; - } - private: - const LLUUID& blocked_id; - }; - - LLNotificationsUI::LLChannelManager::getInstance()->killToastsFromChannel(LLUUID( - gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(item_id)); + script_question_mute(task_id,notification["payload"]["object_name"].asString()); } return false; } + +void script_question_mute(const LLUUID& task_id, const std::string& object_name) +{ + LLMuteList::getInstance()->add(LLMute(task_id, object_name, LLMute::OBJECT)); + + // purge the message queue of any previously queued requests from the same source. DEV-4879 + class OfferMatcher : public LLNotificationsUI::LLScreenChannel::Matcher + { + public: + OfferMatcher(const LLUUID& to_block) : blocked_id(to_block) {} + bool matches(const LLNotificationPtr notification) const + { + if (notification->getName() == "ScriptQuestionCaution" + || notification->getName() == "ScriptQuestion" + || notification->getName() == "UnknownScriptQuestion") + { + return (notification->getPayload()["task_id"].asUUID() == blocked_id); + } + return false; + } + private: + const LLUUID& blocked_id; + }; + + LLNotificationsUI::LLChannelManager::getInstance()->killToastsFromChannel(LLUUID( + gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(task_id)); +} + static LLNotificationFunctorRegistration script_question_cb_reg_1("ScriptQuestion", script_question_cb); static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestionCaution", script_question_cb); +static LLNotificationFunctorRegistration unknown_script_question_cb_reg("UnknownScriptQuestion", unknown_script_question_cb); void process_script_question(LLMessageSystem *msg, void **user_data) { @@ -6424,7 +6453,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLSD args; args["OBJECTNAME"] = object_name; args["NAME"] = LLCacheName::cleanFullName(owner_name); - + S32 known_questions = 0; BOOL has_not_only_debit = questions ^ LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_DEBIT]; // check the received permission flags against each permission for (S32 i = 0; i < SCRIPT_PERMISSION_EOF; i++) @@ -6432,7 +6461,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) if (questions & LSCRIPTRunTimePermissionBits[i]) { count++; - + known_questions |= LSCRIPTRunTimePermissionBits[i]; // check whether permission question should cause special caution dialog caution |= (SCRIPT_QUESTION_IS_CAUTION[i]); @@ -6442,32 +6471,46 @@ void process_script_question(LLMessageSystem *msg, void **user_data) script_question += " " + LLTrans::getString(SCRIPT_QUESTIONS[i]) + "\n"; } } + args["QUESTIONS"] = script_question; - LLSD payload; - payload["task_id"] = taskid; - payload["item_id"] = itemid; - payload["sender"] = sender.getIPandPort(); - payload["questions"] = questions; - payload["object_name"] = object_name; - payload["owner_name"] = owner_name; - - // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + if (known_questions != questions) + { // This is in addition to the normal dialog. + LLSD payload; + payload["task_id"] = taskid; + payload["item_id"] = itemid; + payload["object_name"] = object_name; + + args["DOWNLOADURL"] = LLTrans::getString("ViewerDownloadURL"); + LLNotificationsUtil::add("UnknownScriptQuestion",args,payload); + } + + if (known_questions) { - if (caution) + LLSD payload; + payload["task_id"] = taskid; + payload["item_id"] = itemid; + payload["sender"] = sender.getIPandPort(); + payload["questions"] = known_questions; + payload["object_name"] = object_name; + payload["owner_name"] = owner_name; + + // check whether cautions are even enabled or not + if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { - args["FOOTERTEXT"] = (count > 1) ? LLTrans::getString("AdditionalPermissionsRequestHeader") + "\n\n" + script_question : ""; + 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); } - // 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); } - } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 6cc8387328..970a11c6c4 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6923,8 +6923,30 @@ Do not allow access if you do not fully understand why it wants access to your a [FOOTERTEXT] </footer> </notification> + + <notification + icon="notify.tga" + name="UnknownScriptQuestion" + persist="false" + type="notify"> +The runtime script permission requested by '<nolink>[OBJECTNAME]</nolink>', an object owned by '[NAME]', isn't recognized by the viewer and can't be granted. + +To grant this permission please update your viewer to the latest version from [DOWNLOADURL]. + <tag>confirm</tag> + <form name="form"> + <button + default="true" + index="1" + name="Deny" + text="Ok"/> + <button + index="2" + name="Mute" + text="Block"/> + </form> + </notification> - <notification + <notification icon="notify.tga" name="ScriptDialog" show_toast="false" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7c08aef65e..3b57ff5fd6 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -61,6 +61,7 @@ <string name="Quit">Quit</string> <string name="create_account_url">http://join.secondlife.com/?sourceid=[sourceid]</string> + <string name="ViewerDownloadURL">http://secondlife.com/download</string> <string name="LoginFailedViewerNotPermitted"> The viewer you are using can no longer access Second Life. Please visit the following page to download a new viewer: http://secondlife.com/download @@ -410,7 +411,12 @@ Please try logging in again in a minute.</string> <string name="NotConnected">Not Connected</string> <string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name --> <string name="TeleportYourAgent">Teleport you</string> - + <string name="JoinAnExperience">Join an experience</string> <!-- not used --> + <string name="SilentlyManageEstateAccess">Suppress alerts when managing estate access lists</string> + <string name="OverrideYourAnimations">Replace your default animations</string> + <string name="ScriptReturnObjects">Return objects on your behalf</string> + <string name="UnknownScriptPermission">(unknown)!</string> + <!-- Sim Access labels --> <string name="SIM_ACCESS_PG">General</string> <string name="SIM_ACCESS_MATURE">Moderate</string> |