summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2013-09-24 19:10:43 -0700
committerdolphin <dolphin@lindenlab.com>2013-09-24 19:10:43 -0700
commit09964ec6ede2c9dba5954448bff6b2da2dc179af (patch)
treed77702dba541a88c5b29e148d5cb1565fa1abbb8
parent48e1e10fd69aaea6ef22feb2518e80a120e9f999 (diff)
Created an experience specific permissions dialog.
-rwxr-xr-xindra/llmessage/message_prehash.cpp2
-rwxr-xr-xindra/llmessage/message_prehash.h2
-rw-r--r--indra/newview/llfloaterexperienceprofile.cpp4
-rwxr-xr-xindra/newview/llviewermessage.cpp79
-rw-r--r--indra/newview/skins/default/xui/en/floater_experienceprofile.xml4
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml34
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml4
-rwxr-xr-xscripts/messages/message_template.msg4
-rwxr-xr-xscripts/messages/message_template.msg.sha12
9 files changed, 114 insertions, 21 deletions
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index 39cfb6019e..e0f69dc2d3 100755
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1383,3 +1383,5 @@ char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->
char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData");
char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion");
char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion");
+char const* const _PREHASH_Experience = LLMessageStringTable::getInstance()->getString("Experience");
+char const* const _PREHASH_ExperienceID = LLMessageStringTable::getInstance()->getString("ExperienceID");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index 573e10dc0b..fb8dcc17fb 100755
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1383,4 +1383,6 @@ extern char const* const _PREHASH_GroupAVSounds;
extern char const* const _PREHASH_AppearanceData;
extern char const* const _PREHASH_AppearanceVersion;
extern char const* const _PREHASH_CofVersion;
+extern char const* const _PREHASH_Experience;
+extern char const* const _PREHASH_ExperienceID;
#endif
diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp
index 01af6b1cab..f99e20f7e0 100644
--- a/indra/newview/llfloaterexperienceprofile.cpp
+++ b/indra/newview/llfloaterexperienceprofile.cpp
@@ -417,7 +417,9 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience )
if(properties & LLExperienceCache::PROPERTY_GRID)
{
topPanel->setVisible(TRUE);
- getChild<LLTextBox>(TF_GRID_WIDE)->setVisible(TRUE);
+ child=getChild<LLTextBox>(TF_GRID_WIDE);
+ child->setVisible(TRUE);
+ child->setText(LLTrans::getString("GRID_WIDE"));
}
value=experience[LLExperienceCache::METADATA].asString();
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 <boost/regex.hpp>
#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;
diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
index a3408c5e58..ca9469474c 100644
--- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
+++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml
@@ -103,9 +103,7 @@
left="10"
right="-123"
visible="false"
- name="grid_wide">
- Grid-wide
- </text>
+ name="grid_wide"/>
<button
follows="top|right"
height="23"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index ebd2799ebf..ef4044bedd 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6930,6 +6930,40 @@ Is this OK?
text="Block"/>
</form>
</notification>
+ <notification
+ icon="notify.tga"
+ name="ScriptQuestionExperience"
+ persist="true"
+ type="notify">
+&apos;&lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;&apos;, an object owned by &apos;[NAME]&apos;, requests your participation in the [GRID_WIDE]experience:
+
+[EXPERIENCE]
+
+Once permission is granted you will not see this message again for this experience unless it is revoked from the experience profile.
+
+Scripts associated with this experience will be able to do the following on regions where the experience is active:
+
+[QUESTIONS]Is this OK?
+ <tag>confirm</tag>
+ <form name="form">
+ <button
+ index="0"
+ name="Yes"
+ text="Yes"/>
+ <button
+ index="1"
+ name="No"
+ text="No"/>
+ <button
+ index="2"
+ name="Mute"
+ text="Block Object"/>
+ <button
+ index="3"
+ name="BlockExperience"
+ text="Block Experience"/>
+ </form>
+ </notification>
<notification
icon="notify.tga"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 0c84d904a8..fc189b5d62 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -414,7 +414,8 @@ 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="JoinAnExperience"></string> <!-- intentionally left blank -->
+
<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>
@@ -3923,6 +3924,7 @@ Try enclosing path to the editor with double quotes.
<!-- Experience Tools strings -->
<string name="experience_tools_experience">Experience</string>
<string name="ExperienceNameNull">(no experience)</string>
+ <string name="GRID_WIDE">Grid-wide</string>
<!-- Conversation log messages -->
<string name="logging_calls_disabled_log_empty">
diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg
index 6702de9b4a..f158142bbc 100755
--- a/scripts/messages/message_template.msg
+++ b/scripts/messages/message_template.msg
@@ -4240,6 +4240,10 @@ version 2.0
{ ObjectName Variable 1 }
{ ObjectOwner Variable 1 }
{ Questions S32 }
+ }
+ {
+ Experience Single
+ { ExperienceID LLUUID }
}
}
diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1
index 7a31177f11..7c62b4ffcd 100755
--- a/scripts/messages/message_template.msg.sha1
+++ b/scripts/messages/message_template.msg.sha1
@@ -1 +1 @@
-4dbf88396c3188ad4c54c4f847a7d8817793668d \ No newline at end of file
+675eb496386ba25cb6433a846e6478546ea9302f \ No newline at end of file