From 7067b31a6114089217e482bfecc58fd56bed4272 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 26 Jun 2009 09:39:58 +0200 Subject: BROKEN logoff/relog crashing inconsistently on various startup states. --- linden/indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3fb8e9a..ca091e2 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -109,7 +109,7 @@ #include "llui.h" // for make_ui_sound #include "lluploaddialog.h" #include "llviewercamera.h" -#include "llviewercontrol.h" +//#include "llviewercontrol.h" #include "llviewergenericmessage.h" #include "llviewerinventory.h" #include "llviewermenu.h" -- cgit v1.1 From 89a510de10c48ebcf82b98a962e4bf66477dcc93 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 4 Sep 2009 01:56:20 -0500 Subject: Applied Kitty Barnett's RLVa 1.0.1h (Restrained Life) patch. Made a few non-functional changes to help it apply. --- linden/indra/newview/llviewermessage.cpp | 403 +++++++++++++++++++++++++++++-- 1 file changed, 381 insertions(+), 22 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3fb8e9a..1b2ba22 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -140,6 +140,11 @@ #include "llwindebug.h" // For the invalid message handler #endif +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#include "llfloateravatarinfo.h" +extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp +// [/RLVa:KB] + // // Constants // @@ -1007,8 +1012,17 @@ void inventory_offer_callback(S32 button, void* user_data) std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { - from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; - chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + std::string full_name = first_name + " " + last_name; + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + full_name = gRlvHandler.getAnonym(full_name); + } + from_string = std::string("An object named '") + info->mFromName + "' owned by " + full_name; + chatHistory_string = info->mFromName + " owned by " + full_name; +// [/RLVa:KB] + //from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; + //chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; } else { @@ -1027,6 +1041,21 @@ void inventory_offer_callback(S32 button, void* user_data) switch(button) { case IOR_ACCEPT: +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.2a + // Only change the inventory offer's destination folder to the shared root if: + // - the user has enabled the feature + // - the inventory offer came from a script (and specifies a folder) + // - the name starts with the prefix [mDesc format (quotes are part of the string): "[OBJECTNAME] ( http://slurl.com/... )"] + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && + (IM_TASK_INVENTORY_OFFERED == info->mIM) && (LLAssetType::AT_CATEGORY == info->mType) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) ) + { + LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot(); + if (pRlvRoot) + { + info->mFolderID = pRlvRoot->getUUID(); + } + } +// [/RLVa:KB] // ACCEPT. The math for the dialog works, because the accept // for inventory_offered, task_inventory_offer or // group_notice_inventory is 1 greater than the offer integer value. @@ -1189,6 +1218,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) if(indx >= 0) { LLStringUtil::truncate(msg, indx); +// [RLVa:KB] - Version: 1.22.11 | 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)) + { + gRlvHandler.filterLocation(info->mDesc); + } +// [/RLVa:KB] } LLStringUtil::format_map_t args; @@ -1229,6 +1265,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name)); + last_name.clear(); + } +// [/RLVa:KB] args["[FIRST]"] = first_name; args["[LAST]"] = last_name; name_found = TRUE; @@ -1243,7 +1286,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) else { // *TODO:translate -> [FIRST] [LAST] - args["[NAME]"] = info->mFromName; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + args["[NAME]"] = gRlvHandler.getAnonym(info->mFromName); + } +// [/RLVa:KB] + //args["[NAME]"] = info->mFromName; LLNotifyBox::showXml("UserGiveItem", args, &inventory_offer_callback, (void*)info); } @@ -1411,7 +1460,20 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) ) + { + rlvSendBusyMessage(from_id, gRlvHandler.getVersionString(), session_id); + // We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg) + LLPointer im_info = new LLIMInfo(gMessageSystem); + gIMMgr->processIMTypingStop(im_info); + } +// [/RLVa:KB] +// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, 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) @@ -1468,6 +1530,21 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (to_id.isNull()) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + // Filter region messages that weren't sent by a Linden + if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) && + (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + name = gRlvHandler.getAnonym(name); + gRlvHandler.filterNames(message); + } + } +// [/RLVa:KB] + // Message to everyone from GOD args["[NAME]"] = name; args["[MESSAGE]"] = message; @@ -1483,6 +1560,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { // standard message, not from system +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgRecvIM, session_id); + + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } +// [/RLVa:KB] + std::string saved; if(offline == IM_OFFLINE) { @@ -1688,6 +1774,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) ) + { + name = gRlvHandler.getAnonym(name); + } +// [/RLVa:KB] } else { @@ -1732,13 +1825,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryAccepted", args); break; } case IM_INVENTORY_DECLINED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryDeclined", args); break; } @@ -1772,6 +1875,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) ) + { + if (gAgent.isInGroup(session_id)) + { + if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id)) + return; + } + else + { + if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } + } +// [/RLVa:KB] + // standard message, not from system std::string saved; if(offline == IM_OFFLINE) @@ -1818,6 +1937,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } { +// [RLVa:KB] - Version: 1.22.11 | 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)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + gRlvHandler.filterNames(message); + } +// [/RLVa:KB] + // Construct a viewer alert for this message. args["[NAME]"] = name; args["[MESSAGE]"] = message; @@ -1850,12 +1980,48 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { - // *TODO:translate -> [FIRST] [LAST] (maybe) - LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); - args["[NAME]"] = name; - args["[MESSAGE]"] = message; - LLNotifyBox::showXml("OfferTeleport", args, - lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) + if (rlv_handler_t::isEnabled()) + { + // Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure); + return; + } + + // Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + message = rlv_handler_t::cstrHidden; + } + } +// [/RLVa:KB] + +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) ) + { + gRlvHandler.setCanCancelTp(false); + // (see IM_GODLIKE_LURE_USER below) + LLLureInfo* info = new LLLureInfo(from_id, session_id, TRUE); + lure_callback(0, (void*)info); + } + else + { +// [/RLVa:KB] + // *TODO:translate -> [FIRST] [LAST] (maybe) + LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); + args["[NAME]"] = name; + args["[MESSAGE]"] = message; + LLNotifyBox::showXml("OfferTeleport", args, + lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + } +// [/RLVa:KB] } } break; @@ -2200,8 +2366,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) - if (chat.mSourceType == CHAT_SOURCE_OBJECT - && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// if (chat.mSourceType == CHAT_SOURCE_OBJECT +// && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Don't show swirly things for llOwnerSay() chat here because we handle those further down + if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) && + ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) ) +// [/RLVa:KB] { LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); psc->setSourceObject(chatter); @@ -2234,6 +2405,50 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); +// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d + if ( (rlv_handler_t::isEnabled()) && + (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) ) + { + // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment) + BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE; + + // Filtering "rules": + // avatar => filter all avie text (unless it's this avie or they're an exemption) + // objects => filter everything except attachments this avie owns + if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) ) + { + if (!rlvIsEmote(mesg)) + { + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) ) + gRlvHandler.filterChat(mesg, false); + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) ) + { + mesg = "/me ..."; + } + } + + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // 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 (CHAT_SOURCE_AGENT == chat.mSourceType) + { + if (chat.mFromID != gAgent.getID()) + from_name = gRlvHandler.getAnonym(from_name); + } + else + { + if ( (!is_owned_by_me) || (!is_attachment) ) + gRlvHandler.filterNames(from_name); + gRlvHandler.filterNames(mesg); + } + chat.mRlvNamesFiltered = true; + } + } +// [/RLVa:KB] + BOOL ircstyle = FALSE; // Look for IRC-style emotes here so chatbubbles work @@ -2298,8 +2513,76 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) case CHAT_TYPE_WHISPER: verb = " " + LLTrans::getString("whisper") + " "; break; - case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: +// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) + { + mesg.erase(0, 1); + LLStringUtil::toLower(mesg); + + std::string strExecuted, strFailed, strRetained, *pstr; + + typedef boost::tokenizer > tokenizer; + boost::char_separator sep(",", "", boost::drop_empty_tokens); + tokenizer tokens(mesg, sep); + for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + { + if (LLStartUp::getStartupState() == STATE_STARTED) + { + if (gRlvHandler.processCommand(from_id, *itToken, true)) + pstr = &strExecuted; + else + pstr = &strFailed; + } + else + { + gRlvHandler.retainCommand(from_name, from_id, *itToken); + pstr = &strRetained; + } + + if (!pstr->empty()) + pstr->push_back(','); + pstr->append(*itToken); + } + + if (!RlvSettings::getDebug()) + return; + + // Silly people want comprehensive debug messages, blah :p + if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) ) + verb = " executes: @"; + else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) ) + verb = " failed: @"; + else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) ) + verb = " retained: @"; + else + { + verb = ": @"; + if (!strExecuted.empty()) + mesg += "\n - executed: @" + strExecuted; + if (!strFailed.empty()) + mesg += "\n - failed: @" + strFailed; + if (!strRetained.empty()) + mesg += "\n - retained: @" + strRetained; + } + + break; + } +// [/RLVa:KB] +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Copy/paste from above + if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) ) + { + LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); + psc->setSourceObject(chatter); + psc->setColor(color); + //We set the particles to be owned by the object's owner, + //just in case they should be muted by the mute list + psc->setOwnerUUID(owner_id); + LLViewerPartSim::getInstance()->addPartSource(psc); + } +// [/RLVa:KB] + case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_NORMAL: verb = ": "; break; @@ -2368,7 +2651,10 @@ void process_teleport_start(LLMessageSystem *msg, void**) U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -2403,7 +2689,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**) } U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -2740,7 +3029,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // know what you look like. gAgent.sendAgentSetAppearance(); - if (avatarp) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] +// if (avatarp) { // Chat the "back" SLURL. (DEV-4907) LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); @@ -4320,7 +4612,13 @@ void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_q if (viewregion) { // got the region, so include the region and 3d coordinates of the object - notice.setArg("[REGIONNAME]", viewregion->getName()); + notice.setArg("[REGIONNAME]", viewregion->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion); + } +// [/RLVa:KB] std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); notice.setArg("[REGIONPOS]", formatpos); @@ -4525,8 +4823,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e + S32 rlvQuestionsOther = questions; + + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) ) + { + LLViewerObject* pObj = gObjectList.findObject(taskid); + if (pObj) + { + 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]); + } + } + } + + if ( (!caution) && (!rlvQuestionsOther) ) + { + script_question_cb(0, cbdata); + } + else if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [/RLVa:KB] // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + //if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { if (caution) { @@ -4818,6 +5139,21 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata) if(0 == option) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + bool fRlvCensorMessage = false; + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) + { + for (LLDynamicArray::iterator it = invitees->begin(); it != invitees->end(); ++it) + { + if (!gRlvHandler.isException(RLV_BHVR_SENDIM, *it)) + { + fRlvCensorMessage = true; + break; + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_StartLure); msg->nextBlockFast(_PREHASH_AgentData); @@ -4825,7 +5161,10 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata) msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Info); msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. - msg->addStringFast(_PREHASH_Message, text); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + msg->addStringFast(_PREHASH_Message, (!fRlvCensorMessage) ? text : rlv_handler_t::cstrHidden); +// [/RLVa:KB] + //msg->addStringFast(_PREHASH_Message, text); for(LLDynamicArray::iterator itr = invitees->begin(); itr != invitees->end(); ++itr) { msg->nextBlockFast(_PREHASH_TargetData); @@ -4855,8 +5194,28 @@ void handle_lure(LLDynamicArray& ids) { LLDynamicArray* userdata = new LLDynamicArray(ids); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.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)) + { + for (LLDynamicArray::iterator it = ids.begin(); it != ids.end(); ++it) + { + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) && + ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) + { + delete userdata; + return; + } + } + } +// [/RLVa:KB] + LLStringUtil::format_map_t edit_args; - edit_args["[REGION]"] = gAgent.getRegion()->getName(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a + edit_args["[REGION]"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden; +// [/RLVa:KB] + //edit_args["[REGION]"] = gAgent.getRegion()->getName(); if (gAgent.isGodlike()) { gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args, -- cgit v1.1 From efa0d701845542e9ef555260fe6d2ad0beeb0760 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 11 Sep 2009 00:33:33 -0700 Subject: Backported clickable object names from 1.23 --- linden/indra/newview/llviewermessage.cpp | 50 +++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3fb8e9a..26dd86c 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1802,15 +1802,51 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) break; case IM_FROM_TASK: - if (is_busy && !is_owned_by_me) { - return; + if (is_busy && !is_owned_by_me) + { + return; + } + chat.mText = name + separator_string + message.substr(message_offset); + chat.mFromName = name; + + // 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; + } + else + { + // This message originated on a region without the updated code for task id and slurl information. + // We just need a unique ID for this object that isn't the owner ID. + // If it is the owner ID it will overwrite the style that contains the link to that owner's profile. + // This isn't ideal - it will make 1 style for all objects owned by the the same person/group. + // This works because the only thing we can really do in this case is show the owner name and link to their profile. + chat.mFromID = from_id ^ gAgent.getSessionID(); + } + + std::ostringstream link; + link << "secondlife:///app/objectim/" << session_id + << LLURI::mapToQueryString(query_string); + + chat.mURL = link.str(); + + // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because + // IMs from objcts don't open IM sessions. + chat.mSourceType = CHAT_SOURCE_OBJECT; + LLFloaterChat::addChat(chat, FALSE, FALSE); } - chat.mText = name + separator_string + message.substr(message_offset); - // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because - // IMs from objcts don't open IM sessions. - chat.mSourceType = CHAT_SOURCE_OBJECT; - LLFloaterChat::addChat(chat, FALSE, FALSE); break; case IM_FROM_TASK_AS_ALERT: if (is_busy && !is_owned_by_me) -- cgit v1.1 From 187e36f6c51e78b00802af7f1758496993365bf0 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 11 Sep 2009 17:25:17 -0700 Subject: Applied patch for long distance opensim hypergrid tps (SVC-2491) (Feature currently disabled in OpenSim) --- linden/indra/newview/llviewermessage.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3fb8e9a..e4de5b4 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2718,6 +2718,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // appropriate. LLVector3 shift_vector = regionp->getPosRegionFromGlobal( gAgent.getRegion()->getOriginGlobal()); + // don't shift objects, if teleporting more than about 1000 sims, as + // for long teleports shifting objects garbles the view at the target region + if (shift_vector.lengthSquared() > 6.5e10f) + shift_vector = LLVector3::zero; gAgent.setRegion(regionp); gObjectList.shiftObjects(shift_vector); gAssetStorage->setUpstream(msg->getSender()); -- cgit v1.1 From 7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 14 Sep 2009 17:52:41 -0700 Subject: Merged in jacek/next --- linden/indra/newview/llviewermessage.cpp | 403 +++++++++++++++++++++++++++++-- 1 file changed, 381 insertions(+), 22 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 815dc49..e326dac 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -140,6 +140,11 @@ #include "llwindebug.h" // For the invalid message handler #endif +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +#include "llfloateravatarinfo.h" +extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp +// [/RLVa:KB] + // // Constants // @@ -1007,8 +1012,17 @@ void inventory_offer_callback(S32 button, void* user_data) std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { - from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; - chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + std::string full_name = first_name + " " + last_name; + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + full_name = gRlvHandler.getAnonym(full_name); + } + from_string = std::string("An object named '") + info->mFromName + "' owned by " + full_name; + chatHistory_string = info->mFromName + " owned by " + full_name; +// [/RLVa:KB] + //from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; + //chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; } else { @@ -1027,6 +1041,21 @@ void inventory_offer_callback(S32 button, void* user_data) switch(button) { case IOR_ACCEPT: +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.2a + // Only change the inventory offer's destination folder to the shared root if: + // - the user has enabled the feature + // - the inventory offer came from a script (and specifies a folder) + // - the name starts with the prefix [mDesc format (quotes are part of the string): "[OBJECTNAME] ( http://slurl.com/... )"] + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && + (IM_TASK_INVENTORY_OFFERED == info->mIM) && (LLAssetType::AT_CATEGORY == info->mType) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) ) + { + LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot(); + if (pRlvRoot) + { + info->mFolderID = pRlvRoot->getUUID(); + } + } +// [/RLVa:KB] // ACCEPT. The math for the dialog works, because the accept // for inventory_offered, task_inventory_offer or // group_notice_inventory is 1 greater than the offer integer value. @@ -1189,6 +1218,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) if(indx >= 0) { LLStringUtil::truncate(msg, indx); +// [RLVa:KB] - Version: 1.22.11 | 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)) + { + gRlvHandler.filterLocation(info->mDesc); + } +// [/RLVa:KB] } LLStringUtil::format_map_t args; @@ -1229,6 +1265,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) std::string first_name, last_name; if (gCacheName->getName(info->mFromID, first_name, last_name)) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name)); + last_name.clear(); + } +// [/RLVa:KB] args["[FIRST]"] = first_name; args["[LAST]"] = last_name; name_found = TRUE; @@ -1243,7 +1286,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) else { // *TODO:translate -> [FIRST] [LAST] - args["[NAME]"] = info->mFromName; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + { + args["[NAME]"] = gRlvHandler.getAnonym(info->mFromName); + } +// [/RLVa:KB] + //args["[NAME]"] = info->mFromName; LLNotifyBox::showXml("UserGiveItem", args, &inventory_offer_callback, (void*)info); } @@ -1411,7 +1460,20 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // do nothing -- don't distract newbies in // Prelude with global IMs } - else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) ) + { + rlvSendBusyMessage(from_id, gRlvHandler.getVersionString(), session_id); + // We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg) + LLPointer im_info = new LLIMInfo(gMessageSystem); + gIMMgr->processIMTypingStop(im_info); + } +// [/RLVa:KB] +// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, 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) @@ -1468,6 +1530,21 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (to_id.isNull()) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) + // Filter region messages that weren't sent by a Linden + if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) && + (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) ) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + name = gRlvHandler.getAnonym(name); + gRlvHandler.filterNames(message); + } + } +// [/RLVa:KB] + // Message to everyone from GOD args["[NAME]"] = name; args["[MESSAGE]"] = message; @@ -1483,6 +1560,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { // standard message, not from system +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgRecvIM, session_id); + + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } +// [/RLVa:KB] + std::string saved; if(offline == IM_OFFLINE) { @@ -1688,6 +1774,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; info->mType = (LLAssetType::EType) bucketp->asset_type; info->mObjectID = bucketp->object_id; + +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) ) + { + name = gRlvHandler.getAnonym(name); + } +// [/RLVa:KB] } else { @@ -1732,13 +1825,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryAccepted", args); break; } case IM_INVENTORY_DECLINED: { - args["[NAME]"] = name; +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && + (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); + args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); +// [/RLVa:KB] +// args["[NAME]"] = name; LLNotifyBox::showXml("InventoryDeclined", args); break; } @@ -1772,6 +1875,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) ) + { + if (gAgent.isInGroup(session_id)) + { + if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id)) + return; + } + else + { + if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) + message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + } + } +// [/RLVa:KB] + // standard message, not from system std::string saved; if(offline == IM_OFFLINE) @@ -1854,6 +1973,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } { +// [RLVa:KB] - Version: 1.22.11 | 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)) + gRlvHandler.filterLocation(message); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + gRlvHandler.filterNames(message); + } +// [/RLVa:KB] + // Construct a viewer alert for this message. args["[NAME]"] = name; args["[MESSAGE]"] = message; @@ -1886,12 +2016,48 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { - // *TODO:translate -> [FIRST] [LAST] (maybe) - LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); - args["[NAME]"] = name; - args["[MESSAGE]"] = message; - LLNotifyBox::showXml("OfferTeleport", args, - lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) + if (rlv_handler_t::isEnabled()) + { + // Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting + LLVOAvatar* pAvatar = gAgent.getAvatarObject(); + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) ) + { + rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure); + return; + } + + // Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted + if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + message = rlv_handler_t::cstrHidden; + } + } +// [/RLVa:KB] + +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + if ( (rlv_handler_t::isEnabled()) && + ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) ) + { + gRlvHandler.setCanCancelTp(false); + // (see IM_GODLIKE_LURE_USER below) + LLLureInfo* info = new LLLureInfo(from_id, session_id, TRUE); + lure_callback(0, (void*)info); + } + else + { +// [/RLVa:KB] + // *TODO:translate -> [FIRST] [LAST] (maybe) + LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); + args["[NAME]"] = name; + args["[MESSAGE]"] = message; + LLNotifyBox::showXml("OfferTeleport", args, + lure_callback, (void*)info); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b + } +// [/RLVa:KB] } } break; @@ -2236,8 +2402,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) - if (chat.mSourceType == CHAT_SOURCE_OBJECT - && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// if (chat.mSourceType == CHAT_SOURCE_OBJECT +// && chat.mChatType != CHAT_TYPE_DEBUG_MSG) +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Don't show swirly things for llOwnerSay() chat here because we handle those further down + if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) && + ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) ) +// [/RLVa:KB] { LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); psc->setSourceObject(chatter); @@ -2270,6 +2441,50 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); +// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d + if ( (rlv_handler_t::isEnabled()) && + (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) ) + { + // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment) + BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE; + + // Filtering "rules": + // avatar => filter all avie text (unless it's this avie or they're an exemption) + // objects => filter everything except attachments this avie owns + if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) ) + { + if (!rlvIsEmote(mesg)) + { + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) ) + gRlvHandler.filterChat(mesg, false); + } + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) ) + { + mesg = "/me ..."; + } + } + + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + { + // 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 (CHAT_SOURCE_AGENT == chat.mSourceType) + { + if (chat.mFromID != gAgent.getID()) + from_name = gRlvHandler.getAnonym(from_name); + } + else + { + if ( (!is_owned_by_me) || (!is_attachment) ) + gRlvHandler.filterNames(from_name); + gRlvHandler.filterNames(mesg); + } + chat.mRlvNamesFiltered = true; + } + } +// [/RLVa:KB] + BOOL ircstyle = FALSE; // Look for IRC-style emotes here so chatbubbles work @@ -2334,8 +2549,76 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) case CHAT_TYPE_WHISPER: verb = " " + LLTrans::getString("whisper") + " "; break; - case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: +// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) + { + mesg.erase(0, 1); + LLStringUtil::toLower(mesg); + + std::string strExecuted, strFailed, strRetained, *pstr; + + typedef boost::tokenizer > tokenizer; + boost::char_separator sep(",", "", boost::drop_empty_tokens); + tokenizer tokens(mesg, sep); + for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + { + if (LLStartUp::getStartupState() == STATE_STARTED) + { + if (gRlvHandler.processCommand(from_id, *itToken, true)) + pstr = &strExecuted; + else + pstr = &strFailed; + } + else + { + gRlvHandler.retainCommand(from_name, from_id, *itToken); + pstr = &strRetained; + } + + if (!pstr->empty()) + pstr->push_back(','); + pstr->append(*itToken); + } + + if (!RlvSettings::getDebug()) + return; + + // Silly people want comprehensive debug messages, blah :p + if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) ) + verb = " executes: @"; + else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) ) + verb = " failed: @"; + else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) ) + verb = " retained: @"; + else + { + verb = ": @"; + if (!strExecuted.empty()) + mesg += "\n - executed: @" + strExecuted; + if (!strFailed.empty()) + mesg += "\n - failed: @" + strFailed; + if (!strRetained.empty()) + mesg += "\n - retained: @" + strRetained; + } + + break; + } +// [/RLVa:KB] +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // Copy/paste from above + if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) ) + { + LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); + psc->setSourceObject(chatter); + psc->setColor(color); + //We set the particles to be owned by the object's owner, + //just in case they should be muted by the mute list + psc->setOwnerUUID(owner_id); + LLViewerPartSim::getInstance()->addPartSource(psc); + } +// [/RLVa:KB] + case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_NORMAL: verb = ": "; break; @@ -2404,7 +2687,10 @@ void process_teleport_start(LLMessageSystem *msg, void**) U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -2439,7 +2725,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**) } U32 teleport_flags = 0x0; msg->getU32("Info", "TeleportFlags", teleport_flags); - if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) + //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) +// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b + if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) ) +// [/RLVa:KB] { gViewerWindow->setProgressCancelButtonVisible(FALSE); } @@ -2780,7 +3069,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // know what you look like. gAgent.sendAgentSetAppearance(); - if (avatarp) +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) +// [/RLVa:KB] +// if (avatarp) { // Chat the "back" SLURL. (DEV-4907) LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); @@ -4360,7 +4652,13 @@ void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_q if (viewregion) { // got the region, so include the region and 3d coordinates of the object - notice.setArg("[REGIONNAME]", viewregion->getName()); + notice.setArg("[REGIONNAME]", viewregion->getName()); +// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + { + notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion); + } +// [/RLVa:KB] std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); notice.setArg("[REGIONPOS]", formatpos); @@ -4565,8 +4863,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e + S32 rlvQuestionsOther = questions; + + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) ) + { + LLViewerObject* pObj = gObjectList.findObject(taskid); + if (pObj) + { + 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]); + } + } + } + + if ( (!caution) && (!rlvQuestionsOther) ) + { + script_question_cb(0, cbdata); + } + else if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) +// [/RLVa:KB] // check whether cautions are even enabled or not - if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) + //if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) { if (caution) { @@ -4858,6 +5179,21 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata) if(0 == option) { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + bool fRlvCensorMessage = false; + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) + { + for (LLDynamicArray::iterator it = invitees->begin(); it != invitees->end(); ++it) + { + if (!gRlvHandler.isException(RLV_BHVR_SENDIM, *it)) + { + fRlvCensorMessage = true; + break; + } + } + } +// [/RLVa:KB] + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_StartLure); msg->nextBlockFast(_PREHASH_AgentData); @@ -4865,7 +5201,10 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata) msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_Info); msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. - msg->addStringFast(_PREHASH_Message, text); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b + msg->addStringFast(_PREHASH_Message, (!fRlvCensorMessage) ? text : rlv_handler_t::cstrHidden); +// [/RLVa:KB] + //msg->addStringFast(_PREHASH_Message, text); for(LLDynamicArray::iterator itr = invitees->begin(); itr != invitees->end(); ++itr) { msg->nextBlockFast(_PREHASH_TargetData); @@ -4895,8 +5234,28 @@ void handle_lure(LLDynamicArray& ids) { LLDynamicArray* userdata = new LLDynamicArray(ids); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.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)) + { + for (LLDynamicArray::iterator it = ids.begin(); it != ids.end(); ++it) + { + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) && + ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) + { + delete userdata; + return; + } + } + } +// [/RLVa:KB] + LLStringUtil::format_map_t edit_args; - edit_args["[REGION]"] = gAgent.getRegion()->getName(); +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a + edit_args["[REGION]"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden; +// [/RLVa:KB] + //edit_args["[REGION]"] = gAgent.getRegion()->getName(); if (gAgent.isGodlike()) { gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args, -- cgit v1.1 From 4cdef469977e8907b06e1fafb4d7c54a6eff93f9 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 18 Sep 2009 08:52:24 -0700 Subject: Dynamically change max prim size depending upon LL/OpenSim grid (added setting for opensim detection: LoggedIntoOpenSim). OpenSim max is 128m --- linden/indra/newview/llviewermessage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index e326dac..c9a3cb7 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -3152,6 +3152,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // If the server version has changed, display an info box and offer // to display the release notes, unless this is the initial log in. + // Also verify we're on an OpenSimulator here. if (gLastVersionChannel == version_channel) { return; @@ -3163,6 +3164,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) "ServerVersionChanged", display_release_notes, NULL); } + if (version_channel.find("OpenSim") != std::string::npos) + { + gSavedSettings.setBOOL("LoggedIntoOpenSim", TRUE); + } + else + { + gSavedSettings.setBOOL("LoggedIntoOpenSim", FALSE); + } + gLastVersionChannel = version_channel; } -- cgit v1.1 From 68590624652963510e1d5b03107daf7f68348374 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 19 Sep 2009 08:34:11 -0700 Subject: Fixed inventory offers not avatar name (another RLVa bug) --- linden/indra/newview/llviewermessage.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index c9a3cb7..d5d9324 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1266,7 +1266,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) if (gCacheName->getName(info->mFromID, first_name, last_name)) { // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) { first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name)); last_name.clear(); @@ -1287,12 +1287,15 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) { // *TODO:translate -> [FIRST] [LAST] // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) { args["[NAME]"] = gRlvHandler.getAnonym(info->mFromName); } // [/RLVa:KB] - //args["[NAME]"] = info->mFromName; + else + { + args["[NAME]"] = info->mFromName; + } LLNotifyBox::showXml("UserGiveItem", args, &inventory_offer_callback, (void*)info); } -- cgit v1.1 From 153e86b038796e5f449bd084f432a18e12725c6b Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 2 Oct 2009 22:18:02 -0700 Subject: Applied clickable object names for whisper/say/shout from Emerald viewer --- linden/indra/newview/llviewermessage.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index d900cd9..47231fb 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2436,6 +2436,32 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) is_owned_by_me = chatter->permYouOwner(); } + if(chat.mSourceType == CHAT_SOURCE_OBJECT + && chat.mChatType != CHAT_TYPE_DEBUG_MSG + && !owner_id.isNull() + && owner_id != gAgent.getID()) + { + std::string tempname = from_name; + + size_t found = tempname.find(" "); + while(found != std::string::npos) + { + tempname.replace(found, 1, ""); + found = tempname.find(" "); + } + + if (tempname.length() < 1) + { + from_name = "no name"; + chat.mFromName = from_name; + } + + // std::string ownername; + // if(gCacheName->getFullName(owner_id,ownername)) + // from_name += (" (" + ownername + ")"); + chat.mURL = llformat("secondlife:///app/agent/%s/about",owner_id.asString().c_str()); + } + if (is_audible) { BOOL visible_in_chat_bubble = FALSE; -- cgit v1.1 From 955eebfadc1299505d66eee7886ef41ea888a30a Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 3 Oct 2009 04:04:04 -0700 Subject: Object IMs are now prefixed with 'IM: '. As a side effect, names are now clickable when show IMs in chat is enabled --- linden/indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 47231fb..e01aa4f 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1929,7 +1929,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - chat.mText = name + separator_string + message.substr(message_offset); + chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset); chat.mFromName = name; // Build a link to open the object IM info window. -- cgit v1.1 From da8dc22e3763a9767aa943add592f514c5f2ebea Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 3 Oct 2009 06:10:48 -0700 Subject: Added new color setting for Object IMs --- linden/indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index e01aa4f..9b7ec48 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1966,7 +1966,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because // IMs from objcts don't open IM sessions. - chat.mSourceType = CHAT_SOURCE_OBJECT; + chat.mSourceType = CHAT_SOURCE_OBJECT_IM; LLFloaterChat::addChat(chat, FALSE, FALSE); } break; -- cgit v1.1 From 49734bd3e51516690f71f104a4a3249aabfb669e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 3 Oct 2009 23:19:49 -0700 Subject: Reverted slviewer-0-v12100-AllowDiscardForCreator.patch (Was causing usability issues with new notecard creation) --- linden/indra/newview/llviewermessage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 9b7ec48..cecef95 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -837,9 +837,9 @@ void open_offer(const std::vector& items, const std::string& from_name) //if we are throttled, don't display them - Gigs if (check_offer_throttle(from_name, false)) { - // I'm not sure this is a good idea. JC - Definitely a bad idea. HB - //bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID(); - bool show_keep_discard = true; + // I'm not sure this is a good idea. JC + bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID(); + //bool show_keep_discard = true; switch(asset_type) { case LLAssetType::AT_NOTECARD: -- cgit v1.1 From 23d5c59f6833156ee0714ecfba8194dd8708c730 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 6 Oct 2009 22:12:05 -0700 Subject: Applied RLVa-1.0.2c_20091005_Imprudence-1.2.0-diff.patch --- linden/indra/newview/llviewermessage.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index cecef95..33d3d51 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2579,18 +2579,16 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) verb = " " + LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_OWNER: -// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e - if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) +// [RLVa:KB] - Checked: 2009-08-28 (RLVa-1.0.2a) | Modified: RLVa-1.0.2a + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) ) { mesg.erase(0, 1); LLStringUtil::toLower(mesg); std::string strExecuted, strFailed, strRetained, *pstr; - typedef boost::tokenizer > tokenizer; - boost::char_separator sep(",", "", boost::drop_empty_tokens); - tokenizer tokens(mesg, sep); - for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + boost_tokenizer tokens(mesg, boost::char_separator(",", "", boost::drop_empty_tokens)); + for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) { if (LLStartUp::getStartupState() == STATE_STARTED) { -- cgit v1.1 From 0bd17be512fbf47600a7971208244e73424429f4 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 6 Oct 2009 22:16:12 -0700 Subject: Applied RLVa-1.0.3e_20091005_Imprudence-1.2.0-diff.patch by Kitty Barnett --- linden/indra/newview/llviewermessage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 33d3d51..464d687 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1821,6 +1821,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { +// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-09-10 (RLVa-1.0.3a) + if ( (rlv_handler_t::isEnabled()) && (dialog == IM_TASK_INVENTORY_OFFERED) && + (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) && (gRlvHandler.getSharedRoot()) ) + { + LLFirstUse::warnRlvGiveToRLV(); + } +// [/RLVa:KB] + inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); } } -- cgit v1.1 From 4bd4150d06bfd3a47bdcd2b47d388a6453980e70 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 7 Oct 2009 22:31:02 -0700 Subject: Added typing info to mini-map radar --- linden/indra/newview/llviewermessage.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 464d687..c9e0f7f 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -78,6 +78,7 @@ #include "llfloatergroupinfo.h" #include "llfloaterimagepreview.h" #include "llfloaterland.h" +#include "llfloatermap.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" #include "llurldispatcher.h" @@ -2547,6 +2548,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { ((LLVOAvatar*)chatter)->startTyping(); } + + if (LLFloaterMap::getInstance()) + { + LLFloaterMap::getInstance()->updateTypingList(from_id, false); + } + return; } else if (CHAT_TYPE_STOP == chat.mChatType) @@ -2558,6 +2565,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { ((LLVOAvatar*)chatter)->stopTyping(); } + + if (LLFloaterMap::getInstance()) + { + if (LLFloaterMap::getInstance()->getIsTyping(from_id)) + { + LLFloaterMap::getInstance()->updateTypingList(from_id, true); + } + } + return; } -- cgit v1.1 From 9c3fb16e3a90d57ec527d90ae26e686b893e75c7 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 8 Oct 2009 12:27:10 -0700 Subject: Fixed money change notification happening after logout/login --- linden/indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index c9e0f7f..88f6b36 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -4419,7 +4419,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) LLUUID tid; msg->getUUID("MoneyData", "TransactionID", tid); static std::deque recent; - if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange") + if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange") && !gDisconnected && (std::find(recent.rbegin(), recent.rend(), tid) == recent.rend())) { // Make the user confirm the transaction, since they might -- cgit v1.1 From f1616b1196f95c2768de35b0aa80101b57429d59 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 8 Oct 2009 14:36:57 -0700 Subject: Don't show lldialog boxes from muted avatars anymore --- linden/indra/newview/llviewermessage.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 88f6b36..f460996 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -5470,6 +5470,21 @@ void process_script_dialog(LLMessageSystem* msg, void**) msg->getString("Data", "Message", message); msg->getS32("Data", "ChatChannel", info->mChatChannel); + // Don't show lldialog boxes from muted avs -- McCabe + if (!first_name.empty()) + { + std::string agent_name = first_name + " " + last_name; + std::vector mutes = LLMuteList::getInstance()->getMutes(); + for (U32 i = 0; i < mutes.size(); i++) + { + if (mutes[i].mName == agent_name) + { + delete info; + return; + } + } + } + // unused for now LLUUID image_id; msg->getUUID("Data", "ImageID", image_id); -- cgit v1.1 From e34c28e09fc9db32f2e42c4070e60ee19a424994 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Thu, 8 Oct 2009 22:43:51 -0700 Subject: Applied lldialog spam throttle from Emerald viewer --- linden/indra/newview/llviewermessage.cpp | 47 +++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index f460996..d784f52 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -146,6 +146,12 @@ extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp // [/RLVa:KB] +//silly spam define D: +bool dialogSpamOn; +static LLFrameTimer d_spam; +std::map< std::string , S32 > lastd_names; +LLDynamicArray< std::string > blacklisted_names; + // // Constants // @@ -5471,9 +5477,9 @@ void process_script_dialog(LLMessageSystem* msg, void**) msg->getS32("Data", "ChatChannel", info->mChatChannel); // Don't show lldialog boxes from muted avs -- McCabe + std::string agent_name = first_name + " " + last_name; if (!first_name.empty()) { - std::string agent_name = first_name + " " + last_name; std::vector mutes = LLMuteList::getInstance()->getMutes(); for (U32 i = 0; i < mutes.size(); i++) { @@ -5507,6 +5513,45 @@ void process_script_dialog(LLMessageSystem* msg, void**) args["[MESSAGE]"] = message; if (!first_name.empty()) { + // Dialog Spam Prevention by Cryogenic + if(dialogSpamOn) + { + if(!d_spam.getStarted()) + { + d_spam.start(); + } + if(blacklisted_names.find(agent_name) != -1) + { + return; + } + std::map< std::string , S32 >::iterator itr = lastd_names.find(agent_name); + if(itr != lastd_names.end()) + { + if(d_spam.getElapsedTimeF32() <= gSavedSettings.getF32("SpamTime")) + { + if((*itr).second > gSavedSettings.getF32("SpamCount")) + { + blacklisted_names.put(agent_name); + LL_INFOS("process_script_dialog") << "blocked " << info->mObjectID.asString() << " owned by " << agent_name << LL_ENDL;//" (" << key.asString() << ")" <getIsTyping(from_id)) + if (LLFloaterMap::getInstance()->isTyping(from_id)) { LLFloaterMap::getInstance()->updateTypingList(from_id, true); } -- cgit v1.1 From ce82adec2a0124fe27f363653d2652b0f5c61f04 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 16 Oct 2009 16:39:44 -0700 Subject: Applied RLVa-1.0.4e_20091010_SL-1.22.11-diff.patch --- linden/indra/newview/llviewermessage.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3baeec0..c403e3e 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2485,7 +2485,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) color.setVec(1.f,1.f,1.f,1.f); msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); -// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d +// [RLVa:KB] - Checked: 2009-10-06 (RLVa-1.0.4d) | Modified: RLVa-1.0.4d if ( (rlv_handler_t::isEnabled()) && (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) ) { @@ -2495,7 +2495,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // Filtering "rules": // avatar => filter all avie text (unless it's this avie or they're an exemption) // objects => filter everything except attachments this avie owns - if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) ) + if ( ( (CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID()) ) || + ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && ((!is_owned_by_me) || (!is_attachment)) ) ) { if (!rlvIsEmote(mesg)) { @@ -4933,7 +4934,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e S32 rlvQuestionsOther = questions; - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) ) + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTPERMISSION)) ) { LLViewerObject* pObj = gObjectList.findObject(taskid); if (pObj) @@ -5308,7 +5309,7 @@ void handle_lure(LLDynamicArray& ids) for (LLDynamicArray::iterator it = ids.begin(); it != ids.end(); ++it) { const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); - if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) && + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it, RLV_CHECK_PERMISSIVE)) && ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) { delete userdata; -- cgit v1.1 From 4cf2b9abe06996ea5ca1ee68d9008b3bd4d08dc1 Mon Sep 17 00:00:00 2001 From: Kakurady Date: Fri, 16 Oct 2009 13:55:54 -0400 Subject: Fix muting objects with same name as avatar mutes ScriptDialogs from avatar. ScriptDialogs from muted objects or groups will not be displayed either. --- linden/indra/newview/llviewermessage.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'linden/indra/newview/llviewermessage.cpp') diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index c403e3e..eeef114 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -5479,18 +5479,32 @@ void process_script_dialog(LLMessageSystem* msg, void**) // Don't show lldialog boxes from muted avs -- McCabe std::string agent_name = first_name + " " + last_name; - if (!first_name.empty()) + if (!last_name.empty()) { std::vector mutes = LLMuteList::getInstance()->getMutes(); for (U32 i = 0; i < mutes.size(); i++) - { - if (mutes[i].mName == agent_name) + { + //this is almost like saying (mutes[i].mType != LLMute::Object), but more verbose ... -Kaku + if ( + ((mutes[i].mType == LLMute::AGENT) + && (mutes[i].mName == agent_name)) + || ((mutes[i].mType == LLMute::GROUP) + && (mutes[i].mName == last_name)) + || ((mutes[i].mType == LLMute::BY_NAME) + //don't mute groups by name in case a group has a last name as a group name. + && ((mutes[i].mName == agent_name))) + ) { delete info; return; } } } + // or Scriptdialog boxes from muted objects -- Kakurady + if (LLMuteList::getInstance()->isMuted(info->mObjectID, title)){ + delete info; + return; + } // unused for now LLUUID image_id; -- cgit v1.1