summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-06-13 15:28:13 -0400
committerOz Linden <oz@lindenlab.com>2013-06-13 15:28:13 -0400
commit2268bf38339178f93b317693c0a6808807301d64 (patch)
tree0a17c21975babce8422b9b62a1683947f5a58f2c /indra/newview/llviewermessage.cpp
parentd233d8836b610b5e5ca76a1e3bb4d63dc3592e66 (diff)
parentdcfb18373eca7986a73d8b9a1d34970cc0a23ed9 (diff)
merge changes for 3.5.3-release
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp159
1 files changed, 103 insertions, 56 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 35839aeca0..acb384834e 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)
@@ -633,7 +641,6 @@ void send_sound_trigger(const LLUUID& sound_id, F32 gain)
bool join_group_response(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- BOOL delete_context_data = TRUE;
bool accept_invite = false;
LLUUID group_id = notification["payload"]["group_id"].asUUID();
@@ -662,7 +669,6 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
}
else
{
- delete_context_data = FALSE;
LLSD args;
args["NAME"] = name;
LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification["payload"]);
@@ -675,7 +681,6 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
// sure the user is sure they want to join.
if (fee > 0)
{
- delete_context_data = FALSE;
LLSD args;
args["COST"] = llformat("%d", fee);
// Set the fee for next time to 0, so that we don't keep
@@ -3456,7 +3461,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
LLColor4 color(1.0f, 1.0f, 1.0f, 1.0f);
LLUUID from_id;
LLUUID owner_id;
- BOOL is_owned_by_me = FALSE;
LLViewerObject* chatter;
msg->getString("ChatData", "FromName", from_name);
@@ -3541,13 +3545,11 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
gAgent.heardChat(chat.mFromID);
}
}
-
- is_owned_by_me = chatter->permYouOwner();
}
if (is_audible)
{
- BOOL visible_in_chat_bubble = FALSE;
+ //BOOL visible_in_chat_bubble = FALSE;
color.setVec(1.f,1.f,1.f,1.f);
msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg);
@@ -3630,7 +3632,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
if (!is_muted && !is_do_not_disturb)
{
- visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles");
+ //visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles");
std::string formated_msg = "";
LLViewerChat::formatChatMsg(chat, formated_msg);
LLChat chat_bubble = chat;
@@ -4970,9 +4972,19 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data)
// Various hacks that aren't statistics, but are being handled here.
//
U32 max_tasks_per_region;
- U32 region_flags;
+ U64 region_flags;
msg->getU32("Region", "ObjectCapacity", max_tasks_per_region);
- msg->getU32("Region", "RegionFlags", region_flags);
+
+ if (msg->has(_PREHASH_RegionInfo))
+ {
+ msg->getU64("RegionInfo", "RegionFlagsExtended", region_flags);
+ }
+ else
+ {
+ U32 flags = 0;
+ msg->getU32("Region", "RegionFlags", flags);
+ region_flags = flags;
+ }
LLViewerRegion* regionp = gAgent.getRegion();
if (regionp)
@@ -6290,6 +6302,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);
@@ -6340,34 +6365,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)
{
@@ -6432,7 +6465,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++)
@@ -6440,7 +6473,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]);
@@ -6450,32 +6483,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);
}
-
}
}