diff options
author | Kelly Washington <kelly@lindenlab.com> | 2013-05-03 00:58:55 +0000 |
---|---|---|
committer | Kelly Washington <kelly@lindenlab.com> | 2013-05-03 00:58:55 +0000 |
commit | 45a44225f5be261bf42d69c0c7ac01b1235c836c (patch) | |
tree | a7a4c54db2b36fccb420c9b4c3dbe15a58757391 /indra | |
parent | 474905badef4679bbce53306c49343703be38263 (diff) |
MAINT-2646 Viewer should neither grant nor display prompts for unimplemented LSL permissions
* Change text of dialog
* Add callback for mute button
reviewed with Richard and Widely.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 66 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 1 |
3 files changed, 50 insertions, 26 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4efe345141..8cd0612226 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6290,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 item_id = notification["payload"]["item_id"].asUUID(); + script_question_mute(item_id,notification["payload"]["object_name"].asString()); + } + return false; +} + bool script_question_cb(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -6340,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(item_id,notification["payload"]["object_name"].asString()); } return false; } + +void script_question_mute(const LLUUID& item_id, const std::string& object_name) +{ + LLMuteList::getInstance()->add(LLMute(item_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()["item_id"].asUUID() == blocked_id); + } + return false; + } + private: + const LLUUID& blocked_id; + }; + + LLNotificationsUI::LLChannelManager::getInstance()->killToastsFromChannel(LLUUID( + gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(item_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) { @@ -6455,6 +6476,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) if (known_questions != questions) { // This is in addition to the normal dialog. + args["DOWNLOADURL"] = LLTrans::getString("ViewerDownloadURL"); LLNotificationsUtil::add("UnknownScriptQuestion",args); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1f39ec041e..1a7ebaccbd 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6869,14 +6869,15 @@ Do not allow access if you do not fully understand why it wants access to your a name="UnknownScriptQuestion" persist="false" type="notify"> - '<nolink>[OBJECTNAME]</nolink>', an object owned by '[NAME]', requested an unknown script runtime permission. +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. -Please update your viewer to grant this permission. +To grant this permission please update your viewer to the latest version from [DOWNLOADURL]. <tag>confirm</tag> <form name="form"> <button - index="0" - name="Ok" + default="true" + index="1" + name="Deny" text="Ok"/> <button index="2" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e52e941c28..3b57ff5fd6 100644 --- 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 |