diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ef5b650ac..8cab7c5f8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1548,18 +1548,16 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // end has already copied the items into your inventory, // so we can fetch it out of our inventory. // [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0e) | Modified: RLVa-1.2.0e -#ifdef RLV_EXTENSION_GIVETORLV_A2A if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && (LLAssetType::AT_CATEGORY == mType) && (RlvInventory::instance().getSharedRoot()) && (mDesc.find(RLV_PUTINV_PREFIX) == 0) ) { - RlvGiveToRLVAgentOffer* pOffer = new RlvGiveToRLVAgentOffer(mObjectID); - pOffer->startFetch(); - if (pOffer->isFinished()) - pOffer->done(); + RlvGiveToRLVAgentOffer* pOfferObserver = new RlvGiveToRLVAgentOffer(mObjectID); + pOfferObserver->startFetch(); + if (pOfferObserver->isFinished()) + pOfferObserver->done(); else - gInventory.addObserver(pOffer); + gInventory.addObserver(pOfferObserver); } -#endif // RLV_EXTENSION_GIVETORLV_A2A // [/RLVa:KB] LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string); @@ -1666,17 +1664,8 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& return false; } - -void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) +void inventory_offer_handler(LLOfferInfo* info) { - //Until throttling is implemented, busy mode should reject inventory instead of silently - //accepting it. SEE SL-39554 - if (gAgent.getBusy()) - { - info->forceResponse(IOR_BUSY); - return; - } - // NaCl - Antispam Registry static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); if(antispam || gSavedSettings.getBOOL("AntiSpamItemOffers") || NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_INVENTORY,info->mFromID)) @@ -1712,13 +1701,6 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) if(indx >= 0) { LLStringUtil::truncate(msg, indx); -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a - // TODO-RLVa: needs revisiting when LL saves open notifications to disk to accept them on the next relog - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - { - RlvUtil::filterLocation(info->mDesc); - } -// [/RLVa:KB] } LLSD args; @@ -1765,7 +1747,8 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) std::string full_name; if (gCacheName->getFullName(info->mFromID, full_name)) { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only filter if the object owner is a nearby agent if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) { full_name = RlvStrings::getAnonym(full_name); @@ -1780,14 +1763,17 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) LLNotification::Params p("ObjectGiveItem"); p.substitutions(args).payload(payload).functor(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); - if (from_task) + // Object -> Agent Inventory Offer + if (info->mFromObject) { p.name = name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser"; } - else + else // Agent -> Agent Inventory Offer { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + // Only filter if the offer is from a nearby agent and if there's no open IM session (doesn't necessarily have to be focused) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) && + (!RlvUIEnabler::hasOpenIM(info->mFromID)) ) { args["NAME"] = RlvStrings::getAnonym(info->mFromName); } @@ -2225,11 +2211,16 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [/RLVa:KB] // else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) // [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - else if (offline == IM_ONLINE && !is_linden && is_busy && !is_muted && name != SYSTEM_FROM && gRlvHandler.canReceiveIM(from_id)) + else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && (gRlvHandler.canReceiveIM(from_id)) ) // [/RLVa:KB] { + // return a standard "busy" message, but only do it to online IM + // (i.e. not other auto responses and not store-and-forward IM) if (!gIMMgr->hasSession(session_id) || gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat")) { + // if the user wants to repeat responses over and over or + // if there is not a panel for this conversation (i.e. it is a new IM conversation + // initiated by the other party) then... if (to_id.notNull()) busy_message(msg, from_id); } @@ -2731,13 +2722,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; info->mFromObject = FALSE; - -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) ) - { - name = RlvStrings::getAnonym(name); - } -// [/RLVa:KB] } else // IM_TASK_INVENTORY_OFFERED { @@ -2764,27 +2748,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) //if (((is_busy && !is_owned_by_me) || is_muted)) if (is_muted) { + // Prefetch the offered item so that it can be discarded by the appropriate observer. (EXT-4331) + LLInventoryFetchItemsObserver* fetch_item = new LLInventoryFetchItemsObserver(info->mObjectID); + fetch_item->startFetch(); + delete fetch_item; + // Same as closing window info->forceResponse(IOR_DECLINE); } + else if (is_busy && dialog != IM_TASK_INVENTORY_OFFERED) // busy mode must not affect interaction with objects (STORM-565) + { + // Until throttling is implemented, busy mode should reject inventory instead of silently + // accepting it. SEE SL-39554 + info->forceResponse(IOR_DECLINE); + } else { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l - if ( (rlv_handler_t::isEnabled()) && - ( - ((IM_TASK_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1)) -#ifdef RLV_EXTENSION_GIVETORLV_A2A - || ((IM_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 0)) -#endif // RLV_EXTENSION_GIVETORLV_A2A - ) && - (RlvInventory::instance().getSharedRoot()) ) - { - - RlvUtil::warnGiveToRLV(); - } -// [/RLVa:KB] - - inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); + inventory_offer_handler(info); } } break; @@ -2844,7 +2824,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // { // return; // } -// [RLVa:KB] - Checked: 2011-09-17 (RLVa-1.1.4b) | Modified: RLVa-1.1.4b +// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c LLFloaterIMPanel* pIMFloater = gIMMgr->findFloaterBySession(session_id); if (!pIMFloater) { @@ -2919,15 +2899,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Build a link to open the object IM info window. std::string location = ll_safe_string((char*)binary_bucket, binary_bucket_size); - LLSD query_string; - query_string["owner"] = from_id; - query_string["slurl"] = location.c_str(); - query_string["name"] = name; - if (from_group) - { - query_string["groupowned"] = "true"; - } - if (session_id.notNull()) { chat.mFromID = session_id; @@ -2958,11 +2929,38 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // IDEVO Some messages have embedded resident names message = clean_name_from_task_im(message, from_group); - std::ostringstream link; - link << "secondlife:///app/objectim/" << session_id - << LLURI::mapToQueryString(query_string); + LLSD query_string; + query_string["owner"] = from_id; +// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f + if (rlv_handler_t::isEnabled()) + { + // NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat() + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) + { + query_string["rlv_shownames"] = TRUE; - chat.mURL = link.str(); + RlvUtil::filterNames(name); + chat.mFromName = name; + } + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + { + std::string::size_type idxPos = location.find('/'); + if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) ) + location = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + } + } +// [/RLVa:KB] + query_string["slurl"] = location; + query_string["name"] = name; + if (from_group) + { + query_string["groupowned"] = "true"; + } + +// chat.mURL = LLSLURL("objectim", session_id, "").getSLURLString(); +// [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a + chat.mURL = LLSLURL("objectim", session_id, LLURI::mapToQueryString(query_string)).getSLURLString(); +// [/SL:KB] chat.mText = name + separator_string + message.substr(message_offset); // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because @@ -2980,16 +2978,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) - // TODO-RLVa: what actually generates this? - if (rlv_handler_t::isEnabled()) - { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - RlvUtil::filterLocation(message); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - RlvUtil::filterNames(message); - } -// [/RLVa:KB] // Construct a viewer alert for this message. args["NAME"] = name; args["MESSAGE"] = message; @@ -3034,24 +3022,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { -// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c - if (rlv_handler_t::isEnabled()) - { - if (!gRlvHandler.canTeleportViaLure(from_id)) - { - RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); - if (is_busy) - busy_message(msg,from_id); - return; - } - - // Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) @showloc=n restricted - if ( (!gRlvHandler.canReceiveIM(from_id)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) - { - message = RlvStrings::getString(RLV_STRING_HIDDEN); - } - } -// [/RLVa:KB] LLVector3 pos, look_at; U64 region_handle(0); U8 region_access(SIM_ACCESS_MIN); @@ -3103,6 +3073,26 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } } + +// [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c + if (rlv_handler_t::isEnabled()) + { + if (!gRlvHandler.canTeleportViaLure(from_id)) + { + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); + if (is_busy) + busy_message(msg,from_id); + return; + } + + // Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) @showloc=n restricted + if ( (!gRlvHandler.canReceiveIM(from_id)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + message = RlvStrings::getString(RLV_STRING_HIDDEN); + } + } +// [/RLVa:KB] + LLSD args; // *TODO: Translate -> [FIRST] [LAST] (maybe) args["NAME"] = name; @@ -3848,39 +3838,62 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) && (CHAT_TYPE_OWNER != chat.mChatType) ) ) { - if (!RlvUtil::isEmote(mesg)) + bool fIsEmote = RlvUtil::isEmote(mesg); + if ((!fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHATFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVCHATFROM, from_id))) )) { - if ( ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id))) && - ((!gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHATFROM)) || (gRlvHandler.isException(RLV_BHVR_RECVCHATFROM, from_id))) ) - { - gRlvHandler.filterChat(mesg, false); - } + if ( (gRlvHandler.filterChat(mesg, false)) && (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) ) + return; } - else if ( ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id))) && - ((!gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTEFROM)) || (gRlvHandler.isException(RLV_BHVR_RECVEMOTEFROM, from_id))) ) + else if ((fIsEmote) && + (((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id))) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTEFROM)) && (gRlvHandler.isException(RLV_BHVR_RECVEMOTEFROM, from_id))) )) { + if (!gSavedSettings.getBOOL("RestrainedLoveShowEllipsis")) + return; mesg = "/me ..."; } } // Filtering "rules": // avatar => filter only their name (unless it's this avie) - // other => filter everything except attachments this avie owns but then we still do filter their text - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ((CHAT_SOURCE_AGENT != chat.mSourceType) || (chat.mFromID != gAgent.getID())) ) + // other => filter everything + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - if (CHAT_SOURCE_AGENT == chat.mSourceType) - { - chat.mFromName = from_name = RlvStrings::getAnonym(from_name); - chat.mRlvNamesFiltered = TRUE; - } - else if ( (!is_owned_by_me) || (!is_attachment) ) + if (CHAT_SOURCE_AGENT != chat.mSourceType) { RlvUtil::filterNames(chat.mFromName); } + else if (chat.mFromID != gAgent.getID()) + { + chat.mFromName = RlvStrings::getAnonym(chat.mFromName); + chat.mRlvNamesFiltered = TRUE; + } + } + + // Create an "objectim" URL for objects if we're either @shownames or @showloc restricted + // (we need to do this now because we won't be have enough information to do it later on) + if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) ) + { + LLSD sdQuery; + sdQuery["name"] = chat.mFromName; + sdQuery["owner"] = owner_id; + + /* Singu Note: We don't use this field, seems like part of llinspectremoteobject + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) ) + sdQuery["rlv_shownames"] = true; + */ + + const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); + if (pRegion) + sdQuery["slurl"] = LLSLURL(pRegion->getName(), chat.mPosAgent).getLocationString(); + + chat.mURL = LLSLURL("objectim", from_id, LLURI::mapToQueryString(sdQuery)).getSLURLString(); } -// [/RLVa:KB] } +// [/RLVa:KB] BOOL ircstyle = FALSE; @@ -4486,10 +4499,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // know what you look like. gAgent.sendAgentSetAppearance(); -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - if (isAgentAvatarValid() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) -// [/RLVa:KB] -// if (isAgentAvatarValid()) + if (isAgentAvatarValid()) { // Chat the "back" SLURL. (DEV-4907) @@ -6545,6 +6555,15 @@ void process_alert_core(const std::string& message, BOOL modal) else { std::string new_msg =LLNotificationTemplates::instance().getGlobalString(text); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == text) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); } @@ -6553,6 +6572,15 @@ void process_alert_core(const std::string& message, BOOL modal) { LLSD args; std::string new_msg =LLNotificationTemplates::instance().getGlobalString(message); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] args["ERROR_MESSAGE"] = new_msg; LLNotificationsUtil::add("ErrorMessage", args); } @@ -6568,6 +6596,16 @@ void process_alert_core(const std::string& message, BOOL modal) std::string localized_msg; bool is_message_localized = LLTrans::findString(localized_msg, new_msg); +// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 + if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + RlvUtil::filterLocation(new_msg); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + RlvUtil::filterNames(new_msg); + } +// [/RLVa:KB] + args["MESSAGE"] = is_message_localized ? localized_msg : new_msg; LLNotificationsUtil::add("SystemMessageTip", args); } @@ -6793,11 +6831,21 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp // log a chat message as long as at least one requested permission // is a caution permission +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) if (caution) { - LLChat chat(notice.getString()); - LLFloaterChat::addChat(chat, FALSE, FALSE); + LLChat chat_msg(notice.getString()); + chat_msg.mFromName = SYSTEM_FROM; + chat_msg.mFromID = LLUUID::null; + chat_msg.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat_msg); } +// [/RLVa:KB] +// if (caution) +// { +// LLChat chat(notice.getString()); +// LLFloaterChat::addChat(chat, FALSE, FALSE); +// } } } @@ -6843,12 +6891,22 @@ bool script_question_cb(const LLSD& notification, const LLSD& response) msg->sendReliable(LLHost(notification["payload"]["sender"].asString())); // only log a chat message if caution prompts are enabled - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (gSavedSettings.getBOOL("PermissionsCautionEnabled")) || (notification["payload"]["rlv_notify"].asBoolean()) ) +// [/RLVa:KB] { // log a chat message, if appropriate notify_cautioned_script_question(notification, response, orig, allowed); } +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if ( (allowed) && (notification["payload"].has("rlv_blocked")) ) + { + RlvUtil::notifyBlocked(notification["payload"]["rlv_blocked"], LLSD().with("OBJECT", notification["payload"]["object_name"])); + } +// [/RLVa:KB] + if ( response["Mute"] ) // mute { LLMuteList::getInstance()->add(LLMute(item_id, notification["payload"]["object_name"].asString(), LLMute::OBJECT)); @@ -6978,24 +7036,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data) payload["object_name"] = object_name; payload["owner_name"] = owner_name; -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e - S32 rlvQuestionsOther = questions; - - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) ) +// [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) + if (rlv_handler_t::isEnabled()) { - LLViewerObject* pObj = gObjectList.findObject(taskid); - if (pObj) + RlvUtil::filterScriptQuestions(questions, payload); + + if ( (questions) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) ) { -// if (pObj->permYouOwner()) -// { - // PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns - rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] | - LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]); -// } + const LLViewerObject* pObj = gObjectList.findObject(taskid); + if (pObj) + { + if ( (pObj->permYouOwner()) && (!pObj->isAttachment()) ) + { + questions &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] | + LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]); + } + else + { + questions &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS]); + } + payload["rlv_notify"] = !pObj->permYouOwner(); + } } } - if ( (!caution) && (!rlvQuestionsOther) ) + if ( (!caution) && (!questions) ) { LLNotifications::instance().forceResponse( LLNotification::Params("ScriptQuestion").substitutions(args).payload(payload), 0/*YES*/); @@ -7425,7 +7490,7 @@ void handle_lure(const uuid_vec_t& ids) if (!gAgent.getRegion()) return; LLSD edit_args; -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); // [/RLVa:KB] @@ -7436,7 +7501,7 @@ void handle_lure(const uuid_vec_t& ids) it != ids.end(); ++it) { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a +// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index f7eec9322..e24c5f3d8 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -3,10 +3,10 @@ * Copyright (c) 2009-2011, Kitty Barnett * * The source code in this file is provided to you under the terms of the - * GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY; + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the GPL can be found in doc/GPL-license.txt - * in this distribution, or online at http://www.gnu.org/licenses/gpl-2.0.txt + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt * * By copying, modifying or distributing this software, you acknowledge that * you have read and understood your obligations described above, and agree to @@ -28,15 +28,13 @@ #include "llviewerstats.h" #include "llvoavatar.h" #include "llworld.h" -#include "llnotifications.h" - -#include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* #include "rlvcommon.h" #include "rlvhelper.h" #include "rlvhandler.h" #include "rlvlocks.h" +#include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* #include using namespace LLOldEvents; @@ -72,14 +70,17 @@ using namespace LLOldEvents; } */ // Checked: 2009-11-13 (RLVa-1.1.0b) | Modified: RLVa-1.1.0b -void RlvUtil::warnGiveToRLV() +/* +void RlvNotifications::warnGiveToRLV() { if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) LLNotifications::instance().add(RLV_SETTING_FIRSTUSE_GIVETORLV, LLSD(), LLSD(), &RlvUtil::onGiveToRLVConfirmation); } +*/ // Checked: 2009-11-13 (RLVa-1.1.0b) | Modified: RLVa-1.1.0b -void RlvUtil::onGiveToRLVConfirmation(const LLSD& notification, const LLSD& response) +/* +void RlvNotifications::onGiveToRLVConfirmation(const LLSD& notification, const LLSD& response) { gSavedSettings.setWarning(RLV_SETTING_FIRSTUSE_GIVETORLV, FALSE); @@ -87,6 +88,7 @@ void RlvUtil::onGiveToRLVConfirmation(const LLSD& notification, const LLSD& resp if ( (0 == idxOption) || (1 == idxOption) ) gSavedSettings.setBOOL(RLV_SETTING_FORBIDGIVETORLV, (idxOption == 1)); } +*/ // ========================================================================= // RlvSettings @@ -100,7 +102,7 @@ bool RlvSettings::fLegacyNaming = true; bool RlvSettings::fNoSetEnv = false; bool RlvSettings::fShowNameTags = false; -// Checked: 2009-12-18 (RLVa-1.1.0k) | Modified: RLVa-1.1.0i +// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0i void RlvSettings::initClass() { static bool fInitialized = false; @@ -134,6 +136,7 @@ void RlvSettings::initClass() if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU)) gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel)); + fInitialized = true; } } @@ -163,6 +166,7 @@ bool RlvSettings::onChangedAvatarOffset(const LLSD& sdValue) } return true; } + // Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b bool RlvSettings::onChangedMenuLevel() { @@ -288,7 +292,7 @@ const std::string& RlvStrings::getAnonym(const std::string& strName) const std::string& RlvStrings::getString(const std::string& strStringName) { static const std::string strMissing = "(Missing RLVa string)"; - std::map::const_iterator itString = m_StringMap.find(strStringName); + string_map_t::const_iterator itString = m_StringMap.find(strStringName); return (itString != m_StringMap.end()) ? itString->second : strMissing; } @@ -333,7 +337,7 @@ const char* RlvStrings::getStringFromReturnCode(ERlvCmdRet eRet) } // Checked: 2012-02-25 (RLVa-1.4.5) | Modified: RLVa-1.4.5 -std::string RlvStrings::getVersion(bool fLegacy /*=false*/) +std::string RlvStrings::getVersion(bool fLegacy) { return llformat("%s viewer v%d.%d.%d (RLVa %d.%d.%d)", ( (!fLegacy) ? "RestrainedLove" : "RestrainedLife" ), @@ -341,7 +345,7 @@ std::string RlvStrings::getVersion(bool fLegacy /*=false*/) RLVa_VERSION_MAJOR, RLVa_VERSION_MINOR, RLVa_VERSION_PATCH); } -// Checked: 2010-04-18 (RLVa-1.2.0e) | Added: RLVa-1.2.0e +// Checked: 2010-04-18 (RLVa-1.4.0a) | Added: RLVa-1.2.0e std::string RlvStrings::getVersionAbout() { return llformat("RLV v%d.%d.%d / RLVa v%d.%d.%d%c" , @@ -349,7 +353,7 @@ std::string RlvStrings::getVersionAbout() RLVa_VERSION_MAJOR, RLVa_VERSION_MINOR, RLVa_VERSION_PATCH, 'a' + RLVa_VERSION_BUILD); } -// Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.1.0a +// Checked: 2010-03-27 (RLVa-1.4.0a) | Modified: RLVa-1.1.0a std::string RlvStrings::getVersionNum() { return llformat("%d%02d%02d%02d", RLV_VERSION_MAJOR, RLV_VERSION_MINOR, RLV_VERSION_PATCH, RLV_VERSION_BUILD); @@ -370,9 +374,6 @@ bool RlvUtil::m_fForceTp = false; // Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a void RlvUtil::filterLocation(std::string& strUTF8Text) { - // TODO-RLVa: if either the region or parcel name is a simple word such as "a" or "the" then confusion will ensue? - // -> not sure how you would go about preventing this though :|... - // Filter any mention of the surrounding region names LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); const std::string& strHiddenRegion = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); @@ -510,7 +511,7 @@ void RlvUtil::notifyFailedAssertion(const std::string& strAssert, const std::str LLNotificationsUtil::add("SystemMessageTip", argsNotify); } -// Checked: 2010-03-27 (RLVa-1.1.3a) | Modified: RLVa-1.2.0b +// Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b void RlvUtil::sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession) { // [See process_improved_im()] @@ -596,15 +597,16 @@ void rlvMenuToggleVisible() }*/ } -bool RlvEnableIfNot::handleEvent(LLPointer, const LLSD& userdata) +// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g +bool RlvEnableIfNot::handleEvent(LLPointer, const LLSD& sdParam) { bool fEnable = true; if (rlv_handler_t::isEnabled()) { - ERlvBehaviour eBhvr = RlvCommand::getBehaviourFromString(userdata["data"].asString()); + ERlvBehaviour eBhvr = RlvCommand::getBehaviourFromString(sdParam["data"].asString()); fEnable = (eBhvr != RLV_BHVR_UNKNOWN) ? !gRlvHandler.hasBehaviour(eBhvr) : true; } - gMenuHolder->findControl(userdata["control"].asString())->setValue(fEnable); + gMenuHolder->findControl(sdParam["control"].asString())->setValue(fEnable); return true; } diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 3d34ab101..a767ed445 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -3,10 +3,10 @@ * Copyright (c) 2009-2011, Kitty Barnett * * The source code in this file is provided to you under the terms of the - * GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY; + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the GPL can be found in doc/GPL-license.txt - * in this distribution, or online at http://www.gnu.org/licenses/gpl-2.0.txt + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt * * By copying, modifying or distributing this software, you acknowledge that * you have read and understood your obligations described above, and agree to @@ -141,7 +141,8 @@ public: protected: static std::vector m_Anonyms; - static std::map m_StringMap; + typedef std::map string_map_t; + static string_map_t m_StringMap; }; // ============================================================================ @@ -172,8 +173,6 @@ public: static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); - static void warnGiveToRLV(); - static void onGiveToRLVConfirmation(const LLSD& notification, const LLSD& response); protected: static bool m_fForceTp; // @standtp }; diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index e80b7e4cc..9f559233e 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -34,7 +34,6 @@ #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: