diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 904b477807..07816cc30c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6487,26 +6487,9 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) if (rlv_handler_t::isEnabled()) { - if ( (!gRlvAttachmentLocks.canAttach()) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH] & questions) ) - { - // Notify the user that we blocked it since they're not allowed to wear any new attachments - payload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMATTACH; - // If only attach is requested we'll auto-deny it; otherwise let the user decide over remaining permissions - if (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH] == questions) - { - payload["questions"] = 0; - LLNotifications::instance().forceResponse( - LLNotification::Params("ScriptQuestion").substitutions(args).payload(payload), 0/*YES*/); - return; - } - else - { - questions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]; - payload["questions"] = questions; - } - } + RlvUtil::filterScriptQuestions(questions, payload); - if (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) + if ( (questions) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) ) { const LLViewerObject* pObj = gObjectList.findObject(taskid); if (pObj) diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 427ecb55cc..26e60f1f05 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -33,6 +33,7 @@ #include "rlvhandler.h" #include "rlvlocks.h" +#include "lscript_byteformat.h" #include // ============================================================================ @@ -349,6 +350,28 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) } } +// Checked: 2012-08-19 (RLVa-1.4.7) +void RlvUtil::filterScriptQuestions(S32& nQuestions, LLSD& sdPayload) +{ + // Check SCRIPT_PERMISSION_ATTACH + if ( (!gRlvAttachmentLocks.canAttach()) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH] & nQuestions) ) + { + // Notify the user that we blocked it since they're not allowed to wear any new attachments + sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMATTACH; + nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]; + } + + // Check SCRIPT_PERMISSION_TELEPORT + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) && (LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT] & nQuestions) ) + { + // Notify the user that we blocked it since they're not allowed to teleport + sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMTELEPORT; + nQuestions &= ~LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT]; + } + + sdPayload["questions"] = nQuestions; +} + // Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c void RlvUtil::forceTp(const LLVector3d& posDest) { diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 4002dbd0fd..f93b7fd71e 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -154,6 +154,7 @@ public: static void filterLocation(std::string& strUTF8Text); // @showloc static void filterNames(std::string& strUTF8Text, bool fFilterLegacy = true); // @shownames + static void filterScriptQuestions(S32& nQuestions, LLSD& sdPayload); static bool isForceTp() { return m_fForceTp; } static void forceTp(const LLVector3d& posDest); // Ignores restrictions that might otherwise prevent tp'ing diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 581b99a62c..a013a8c96d 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -328,6 +328,7 @@ enum ERlvAttachGroupType #define RLV_STRING_BLOCKED_GENERIC "blocked_generic" #define RLV_STRING_BLOCKED_PERMATTACH "blocked_permattach" +#define RLV_STRING_BLOCKED_PERMTELEPORT "blocked_permteleport" #define RLV_STRING_BLOCKED_RECVIM "blocked_recvim" #define RLV_STRING_BLOCKED_RECVIM_REMOTE "blocked_recvim_remote" #define RLV_STRING_BLOCKED_SENDIM "blocked_sendim" diff --git a/indra/newview/skins/default/xui/en/rlva_strings.xml b/indra/newview/skins/default/xui/en/rlva_strings.xml index 8beadd514b..8337286c98 100644 --- a/indra/newview/skins/default/xui/en/rlva_strings.xml +++ b/indra/newview/skins/default/xui/en/rlva_strings.xml @@ -14,6 +14,7 @@ Unable to perform action due to RLV restrictions Attempt to attach '[OBJECT]' was denied due to RLV restrictions + '[OBJECT]' was denied permission to teleport you due to RLV restrictions Unable to start IM session with [RECIPIENT] due to RLV restrictions Unable to start conference with [RECIPIENT] due to RLV restrictions Unable to initiate teleport due to RLV restrictions