diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 59d168745bfd8dd523920027790ea869f40f7a03..8dcb7efbce9ae23cb3667f7aa0b070b16c562bf3 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -599,7 +599,7 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) type = CHAT_TYPE_NORMAL; - animate &= !gRlvHandler.hasBehaviour( (!rlvIsEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); + animate &= !gRlvHandler.hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); } // [/RLVa:KB] diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 310448a3ebae224971dbc431b2bf96e635f8f11d..41d63c368e04354e6826e58d37651929f4008e52 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -120,7 +120,7 @@ void LLFloaterInspect::onClickCreatorProfile() // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e const LLUUID& idCreator = node->mPermissions->getCreator(); if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ((node->mPermissions->getOwner() == idCreator) || (RlvHandler::isNearbyAgent(idCreator))) ) + ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) ) { return; } @@ -237,7 +237,7 @@ void LLFloaterInspect::refresh() owner_name = RlvStrings::getAnonym(owner_name); const LLUUID& idCreator = obj->mPermissions->getCreator(); - if ( (obj->mPermissions->getOwner() == idCreator) || (RlvHandler::isNearbyAgent(idCreator)) ) + if ( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) ) creator_name = RlvStrings::getAnonym(creator_name); } // [/RLVa:KB] diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index faf19af1e47f4b7b3669199d0abedf0986ef103d..34cb273c5b9e7c5429960336e02149d55838d85b 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -287,7 +287,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) // If the object creator matches the object owner we need to anonimize the creator field as well if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvHandler::isNearbyAgent(item->getCreatorUUID())) ) ) + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) { childSetEnabled("BtnCreator", FALSE); name = RlvStrings::getAnonym(name); @@ -566,7 +566,7 @@ void LLFloaterProperties::onClickCreator() { const LLPermissions& perm = item->getPermissions(); if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvHandler::isNearbyAgent(item->getCreatorUUID())) ) + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) { return; } diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index ec3104d562622381949e8153a8abb66e3e7aa898..fe650bc3447d85a6d265cbf4e078170c4d7ed1c6 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -305,7 +305,7 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); } // [RLVa:KB] - Checked: 2010-05-26 (RLVa-1.2.0h) | Modified: RLVa-1.2.0h - else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isNearbyAgent(to_agent)) && + else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) && (!RlvUIEnabler::hasOpenProfile(to_agent)) ) { // Log to chat history if the user didn't drop on an IM session or a profile to avoid revealing the name of the recipient @@ -418,7 +418,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, // LLRecentPeople::instance().add(to_agent); // [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f) | Added: RLVa-1.2.0f // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!gRlvHandler.isNearbyAgent(to_agent)) || + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) ) { LLRecentPeople::instance().add(to_agent); @@ -481,7 +481,7 @@ void LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, // LLRecentPeople::instance().add(to_agent); // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!gRlvHandler.isNearbyAgent(to_agent)) || + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) ) { LLRecentPeople::instance().add(to_agent); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index a4a4b888afd9f33e9d8029b9c966746aab93680c..6b0801f6db2d725e9724d2ae4794289d29453287 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -570,9 +570,9 @@ void LLHUDText::setStringUTF8(const std::string &wtext) if (gRlvHandler.canShowHoverText(mSourceObject)) { if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - gRlvHandler.filterLocation(text); + RlvUtil::filterLocation(text); if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - gRlvHandler.filterNames(text); + RlvUtil::filterNames(text); } else { diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 175998e11a8f804e03dcede331079d90b0201588..6d0d9b9ab264ad686c1f314e9573ad8c70ae0195 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -488,7 +488,7 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep) // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b // Only anonimize the creator if they're also the owner or if they're a nearby avie if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ((nodep->mPermissions->getOwner() == creator_id) || (RlvHandler::isNearbyAgent(creator_id))) ) + ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id))) ) { // TODO-RLVa: [RLVa-1.2.2] We need to put a callback here in case the name hasn't previously resolved std::string strFullName; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 2e0f957e02f3326189ec538127bab04d9a71be9f..d343d9049be234fd02d3b846fa8ea8371cd2e509 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -728,7 +728,7 @@ void LLNearbyChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) type = CHAT_TYPE_NORMAL; - animate &= !gRlvHandler.hasBehaviour( (!rlvIsEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); + animate &= !gRlvHandler.hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); } // [/RLVa:KB] @@ -901,7 +901,7 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe // Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers) if (CHAT_CHANNEL_DEBUG == channel) { - bool fIsEmote = rlvIsEmote(utf8_out_text); + bool fIsEmote = RlvUtil::isEmote(utf8_out_text); if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) || ((!fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT))) || ((fIsEmote) && (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE))) ) diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 8793525bc7e6c9d2803ece64d0f59ac55ce0eb00..284b27d22d1d8781138bdde1560730e7e54a599e 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -361,12 +361,12 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args) // NOTE-RLVa: we can only filter the *message* here since most everything else will already be part of "args" as well if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) { - gRlvHandler.filterLocation(tmp_chat.mText); + RlvUtil::filterLocation(tmp_chat.mText); tmp_chat.mRlvLocFiltered = TRUE; } if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) { - gRlvHandler.filterNames(tmp_chat.mText); + RlvUtil::filterNames(tmp_chat.mText); tmp_chat.mRlvNamesFiltered = TRUE; } } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index d8fe3fa6cb0100ceb0fb8e3edd277f24a4f4a3e7..839bd3044521666f8d74649b5b946152c4123292 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -369,7 +369,7 @@ void LLPanelPermissions::refresh() if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { // Only anonimize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie - if ( (creators_identical) && ((mCreatorID == mOwnerID) || (RlvHandler::isNearbyAgent(mCreatorID))) ) + if ( (creators_identical) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) creator_name = RlvStrings::getAnonym(creator_name); // Only anonimize the owner name if all of the selection is owned by the same avie and isn't group owned diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 1908532efb4abab11b939de47307e7c8e7fea28e..33d61216322ac5b51f4a276639dcc343e4122757 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -286,7 +286,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // If the object creator matches the object owner we need to anonimize the creator field as well if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvHandler::isNearbyAgent(item->getCreatorUUID())) ) ) + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) { childSetEnabled("BtnCreator", FALSE); name = RlvStrings::getAnonym(name); @@ -630,7 +630,7 @@ void LLSidepanelItemInfo::onClickCreator() { const LLPermissions& perm = item->getPermissions(); if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvHandler::isNearbyAgent(item->getCreatorUUID())) ) + (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) { return; } diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 3112bcd06ba5a6b8f456cc2f3182d92a4811307f..2b46c0fbef3030876e053291a000f8789638d575 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -336,7 +336,7 @@ void LLSidepanelTaskInfo::refresh() if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { // Only anonimize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie - if ( (creators_identical) && ((mCreatorID == mOwnerID) || (RlvHandler::isNearbyAgent(mCreatorID))) ) + if ( (creators_identical) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) creator_name = RlvStrings::getAnonym(creator_name); // Only anonimize the owner name if all of the selection is owned by the same avie and isn't group owned diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index e6ae097f924edff605b9511572999db55e4c9abb..56ce74838918aff4cbd6eab218fb69256f3f5374 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -387,7 +387,7 @@ std::string LLSLURL::getSLURLString() const // LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); // [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d return LLGridManager::getInstance()->getSLURLBase(mGrid) + - ( ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) || (!RlvHandler::isNearbyRegion(mRegion))) + ( ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) || (!RlvUtil::isNearbyRegion(mRegion))) ? (LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z)) : RlvStrings::getString(RLV_STRING_HIDDEN_REGION) ); // [/RLVa:KB] } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1e760c8c55b8d73ebcd3d52432a8d6896fce894a..63f0e77c584a6a882bc7a8d4de5a9727b6589e7c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1384,7 +1384,7 @@ void LLOfferInfo::send_auto_receive_response(void) // LLRecentPeople::instance().add(mFromID); // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f // RELEASE-RLVa: [RLVa-1.2.0] Make sure this stays in sync with the condition in inventory_offer_handler() - if ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!gRlvHandler.isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID))) + if ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID))) { LLRecentPeople::instance().add(mFromID); } @@ -1647,7 +1647,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const { // [RLVa:KB] - Checked: 2010-04-022 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f // RELEASE-RLVa: [RLVa-1.2.0] Make sure this stays in sync with the condition in inventory_offer_handler() - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isNearbyAgent(mFromID)) && + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) && (!RlvUIEnabler::hasOpenIM(mFromID)) ) { strFullName = RlvStrings::getAnonym(strFullName); @@ -1893,7 +1893,7 @@ void inventory_offer_handler(LLOfferInfo* info) { // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f // Only filter if the object owner is a nearby agent - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isNearbyAgent(info->mFromID)) ) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) { payload["rlv_shownames"] = TRUE; args["NAME"] = args["NAME_SLURL"] = RlvStrings::getAnonym(info->mFromName); @@ -1913,7 +1913,7 @@ void inventory_offer_handler(LLOfferInfo* info) { // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f // 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)) && (gRlvHandler.isNearbyAgent(info->mFromID)) && + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) && (!RlvUIEnabler::hasOpenIM(info->mFromID)) ) { payload["rlv_shownames"] = TRUE; @@ -2194,7 +2194,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) ) { // TODO-RLVa: [RLVa-1.2.1] Should we send our version string if the other party is muted? - rlvSendBusyMessage(from_id, RlvStrings::getVersion(), session_id); + RlvUtil::sendBusyMessage(from_id, RlvStrings::getVersion(), session_id); } // [/RLVa:KB] // else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) @@ -2284,7 +2284,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) { if (!mute_im) - rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id); + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id); message = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); } // [/RLVa:KB] @@ -2583,7 +2583,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // args["NAME"] = name; // [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f // Only filter the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open - bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isNearbyAgent(from_id)) && + bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); args["NAME"] = (!fRlvFilterName) ? name : RlvStrings::getAnonym(name); // [/RLVa:KB] @@ -2597,7 +2597,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // args["NAME"] = name; // [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f // Only filter the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open - bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isNearbyAgent(from_id)) && + bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); args["NAME"] = (!fRlvFilterName) ? name : RlvStrings::getAnonym(name); // [/RLVa:KB] @@ -2725,7 +2725,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (rlv_handler_t::isEnabled()) { // NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat() - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (gRlvHandler.isNearbyAgent(from_id)) ) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) { std::string strOwnerName; if (gCacheName->getFullName(from_id, strOwnerName)) @@ -2734,13 +2734,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) query_string["owner_name"] = RlvStrings::getAnonym(strOwnerName); } - gRlvHandler.filterNames(name); + RlvUtil::filterNames(name); chat.mFromName = name; } if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { std::string::size_type idxPos = location.find('/'); - if ( (std::string::npos != idxPos) && (gRlvHandler.isNearbyRegion(location.substr(0, idxPos))) ) + if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) ) location = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); } } @@ -2852,7 +2852,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) ) ) { - rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); return; } @@ -3229,7 +3229,7 @@ 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 (!rlvIsEmote(mesg)) + if (!RlvUtil::isEmote(mesg)) { if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) ) gRlvHandler.filterChat(mesg, false); @@ -3253,7 +3253,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } else if ( (!is_owned_by_me) || (!is_attachment) ) { - gRlvHandler.filterNames(chat.mFromName); + RlvUtil::filterNames(chat.mFromName); } } diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 03a5a92aac18e9a4ec42a6bf6ec901c5c105034e..526005b9075104158ed4aa36ae4cf292bfc9b4f8 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -16,10 +16,16 @@ #include "llviewerprecompiledheaders.h" #include "llagent.h" +#include "llagentui.h" #include "llappviewer.h" +#include "llinstantmessage.h" #include "llnotificationsutil.h" #include "lluictrlfactory.h" #include "llversionviewer.h" +#include "llviewerparcelmgr.h" +#include "llviewerregion.h" +#include "llviewerstats.h" +#include "llworld.h" #include "rlvcommon.h" #include "rlvhandler.h" @@ -320,6 +326,111 @@ bool RlvStrings::hasString(const std::string& strStringName) return m_StringMap.find(strStringName) != m_StringMap.end(); } +// ============================================================================ +// RlvUtil +// + +// 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); + for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) + rlvStringReplace(strUTF8Text, (*itRegion)->getName(), strHiddenRegion); + + // Filter any mention of the parcel name + LLViewerParcelMgr* pParcelMgr = LLViewerParcelMgr::getInstance(); + if (pParcelMgr) + rlvStringReplace(strUTF8Text, pParcelMgr->getAgentParcelName(), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); +} + +// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f +void RlvUtil::filterNames(std::string& strUTF8Text) +{ + std::vector<LLUUID> idAgents; + LLWorld::getInstance()->getAvatars(&idAgents, NULL); + + std::string strFullName; + for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) + { + // LLCacheName::getFullName() will add the UUID to the lookup queue if we don't know it yet + if (gCacheName->getFullName(idAgents[idxAgent], strFullName)) + rlvStringReplace(strUTF8Text, strFullName, RlvStrings::getAnonym(strFullName)); + } +} + +// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f +bool RlvUtil::isNearbyAgent(const LLUUID& idAgent) +{ + // Sanity check since we call this with notification payloads as well and those strings tend to change from one release to another + RLV_ASSERT(idAgent.notNull()); + if ( (idAgent.notNull()) && (gAgent.getID() != idAgent) ) + { + std::vector<LLUUID> idAgents; + LLWorld::getInstance()->getAvatars(&idAgents, NULL); + + for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) + if (idAgents[idxAgent] == idAgent) + return true; + } + return false; +} + +// Checked: 2010-04-05 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d +bool RlvUtil::isNearbyRegion(const std::string& strRegion) +{ + LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); + for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) + if ((*itRegion)->getName() == strRegion) + return true; + return false; +} + +// Checked: 2010-04-08 (RLVa-1.2.0d) | Added: RLVa-1.2.0d +void RlvUtil::notifyFailedAssertion(const char* pstrAssert, const char* pstrFile, int nLine) +{ + LLSD argsNotify; + argsNotify["MESSAGE"] = llformat("RLVa assertion failure: %s (%s - %d)", pstrAssert, pstrFile, nLine); + LLNotificationsUtil::add("SystemMessageTip", argsNotify); +} + +// 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()] + std::string strFullName; + LLAgentUI::buildFullname(strFullName); + + pack_instant_message(gMessageSystem, gAgent.getID(), FALSE, gAgent.getSessionID(), idTo, strFullName, + strMsg, IM_ONLINE, IM_BUSY_AUTO_RESPONSE, idSession); + gAgent.sendReliableMessage(); +} + +// Checked: 2010-03-09 (RLVa-1.2.0a) | Modified: RLVa-1.0.1e +bool RlvUtil::sendChatReply(S32 nChannel, const std::string& strUTF8Text) +{ + if (!isValidReplyChannel(nChannel)) + return false; + + // Copy/paste from send_chat_from_viewer() + gMessageSystem->newMessageFast(_PREHASH_ChatFromViewer); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_ChatData); + gMessageSystem->addStringFast(_PREHASH_Message, strUTF8Text); + gMessageSystem->addU8Fast(_PREHASH_Type, CHAT_TYPE_SHOUT); + gMessageSystem->addS32("Channel", nChannel); + gAgent.sendReliableMessage(); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); + + return true; +} + // ============================================================================ // Generic menu enablers // diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 680997b578915c87b51f95a2b4297cba3233c7d9..c7295ce1fd900ad5bd383591934383c70b3f603f 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -115,6 +115,28 @@ protected: #endif // RLV_EXTENSION_NOTIFY_BEHAVIOUR }; +// ============================================================================ +// RlvUtil - Collection of (static) helper functions +// + +class RlvUtil +{ +public: + static bool isEmote(const std::string& strUTF8Text); + static bool isNearbyAgent(const LLUUID& idAgent); // @shownames + static bool isNearbyRegion(const std::string& strRegion); // @showloc + + static void filterLocation(std::string& strUTF8Text); // @showloc + static void filterNames(std::string& strUTF8Text); // @shownames + + static void notifyFailedAssertion(const char* pstrAssert, const char* pstrFile, int nLine); + + static void sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null); + static bool isValidReplyChannel(S32 nChannel); + static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); + static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); +}; + // ============================================================================ // Extensibility classes // @@ -186,6 +208,29 @@ protected: const LLViewerInventoryItem* m_pItem; }; +// ============================================================================ +// Inlined class member functions +// + +// Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.2a +inline bool RlvUtil::isEmote(const std::string& strUTF8Text) +{ + return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); +} + +// Checked: 2010-03-09 (RLVa-1.2.0b) | Added: RLVa-1.0.2a +inline bool RlvUtil::isValidReplyChannel(S32 nChannel) +{ + return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); +} + +// Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e +inline bool RlvUtil::sendChatReply(const std::string& strChannel, const std::string& strUTF8Text) +{ + S32 nChannel; + return (LLStringUtil::convertToS32(strChannel, nChannel)) ? sendChatReply(nChannel, strUTF8Text) : false; +} + // ============================================================================ #endif // RLV_COMMON_H diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 10ea48d68942a3b968dae13a6ea26825ed872b49..3188edc9dd7cfaf24009e7a590dffcef3f6b6508 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -89,7 +89,7 @@ const S32 RLVa_VERSION_BUILD = 1; #define RLV_INFOS LL_INFOS("RLV") #define RLV_DEBUGS LL_DEBUGS("RLV") #define RLV_ENDL LL_ENDL -#define RLV_VERIFY(f) if (!(f)) { rlvNotifyFailedAssertion(#f, __FILE__, __LINE__); } +#define RLV_VERIFY(f) if (!(f)) { RlvUtil::notifyFailedAssertion(#f, __FILE__, __LINE__); } #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG // Turn on extended debugging information diff --git a/indra/newview/rlvextensions.cpp b/indra/newview/rlvextensions.cpp index 52b266bb0bf0a58a4b1e4d21ec94502369e4442a..de2a1e8c2369fd34c99acb52504c1da463bd949d 100644 --- a/indra/newview/rlvextensions.cpp +++ b/indra/newview/rlvextensions.cpp @@ -82,7 +82,7 @@ bool RlvExtGetSet::processCommand(const LLUUID& idObj, const RlvCommand& rlvCmd, { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { - rlvSendChatReply(rlvCmd.getParam(), onGetDebug(strSetting)); + RlvUtil::sendChatReply(rlvCmd.getParam(), onGetDebug(strSetting)); eRet = RLV_RET_SUCCESS; return true; } @@ -97,7 +97,7 @@ bool RlvExtGetSet::processCommand(const LLUUID& idObj, const RlvCommand& rlvCmd, { if ( ("get" == strGetSet) && (RLV_TYPE_REPLY == rlvCmd.getParamType()) ) { - rlvSendChatReply(rlvCmd.getParam(), onGetEnv(strSetting)); + RlvUtil::sendChatReply(rlvCmd.getParam(), onGetEnv(strSetting)); eRet = RLV_RET_SUCCESS; return true; } diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 8d89f2700172f42368e5804fe659751485a5188b..83d0cf5a6c8e2535a93cc361e6170c4bbcf37b2b 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -22,7 +22,6 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" -#include "llworld.h" #include "rlvhandler.h" #include "rlvinventory.h" @@ -89,7 +88,7 @@ static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, st boost_tokenizer::const_iterator itTok = tokens.begin(); // Extract and sanity check the first token (required) which is the channel - if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidReplyChannel(nChannel)) ) + if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!RlvUtil::isValidReplyChannel(nChannel)) ) return false; // Second token (optional) is the filter @@ -624,7 +623,7 @@ void RlvHandler::filterChat(std::string& strUTF8Text, bool fFilterEmote) const if (strUTF8Text.empty()) return; - if (rlvIsEmote(strUTF8Text)) // Check if it's an emote + if (RlvUtil::isEmote(strUTF8Text)) // Check if it's an emote { if (fFilterEmote) // Emote filtering depends on fFilterEmote { @@ -652,45 +651,11 @@ void RlvHandler::filterChat(std::string& strUTF8Text, bool fFilterEmote) const } } -// Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a -void RlvHandler::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); - for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) - rlvStringReplace(strUTF8Text, (*itRegion)->getName(), strHiddenRegion); - - // Filter any mention of the parcel name - LLViewerParcelMgr* pParcelMgr = LLViewerParcelMgr::getInstance(); - if (pParcelMgr) - rlvStringReplace(strUTF8Text, pParcelMgr->getAgentParcelName(), RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL)); -} - -// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f -void RlvHandler::filterNames(std::string& strUTF8Text) -{ - // TODO-RLVa: [RLVa-1.2.1] Should we restrict this to a certain radius? - std::vector<LLUUID> idAgents; - LLWorld::getInstance()->getAvatars(&idAgents, NULL); - - std::string strFullName; - for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) - { - // LLCacheName::getFullName() will add the UUID to the lookup queue if we don't know it yet - if (gCacheName->getFullName(idAgents[idxAgent], strFullName)) - rlvStringReplace(strUTF8Text, strFullName, RlvStrings::getAnonym(strFullName)); - } -} - // Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0a bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const { // Sanity check - @redirchat only for chat and @rediremote only for emotes - ERlvBehaviour eBhvr = (!rlvIsEmote(strUTF8Text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE; + ERlvBehaviour eBhvr = (!RlvUtil::isEmote(strUTF8Text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE; if (!hasBehaviour(eBhvr)) return false; @@ -707,43 +672,12 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const { S32 nChannel = boost::get<S32>(itRedir->second.varOption); if ( (!hasBehaviour(RLV_BHVR_SENDCHANNEL)) || (isException(RLV_BHVR_SENDCHANNEL, nChannel)) ) - rlvSendChatReply(nChannel, strUTF8Text); + RlvUtil::sendChatReply(nChannel, strUTF8Text); } return true; } -// ============================================================================ -// Public service functions (called by the outside world or by extension handlers) -// - -// Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f -bool RlvHandler::isNearbyAgent(const LLUUID& idAgent) -{ - // Sanity check since we call this with notification payloads as well and those strings tend to change from one release to another - RLV_ASSERT(idAgent.notNull()); - if ( (idAgent.notNull()) && (gAgent.getID() != idAgent) ) - { - std::vector<LLUUID> idAgents; - LLWorld::getInstance()->getAvatars(&idAgents, NULL); - - for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) - if (idAgents[idxAgent] == idAgent) - return true; - } - return false; -} - -// Checked: 2010-04-05 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d -bool RlvHandler::isNearbyRegion(const std::string& strRegion) -{ - LLWorld::region_list_t regions = LLWorld::getInstance()->getRegionList(); - for (LLWorld::region_list_t::const_iterator itRegion = regions.begin(); itRegion != regions.end(); ++itRegion) - if ((*itRegion)->getName() == strRegion) - return true; - return false; -} - // ============================================================================ // Composite folders // @@ -1085,7 +1019,7 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const LLUUID& idObj, const RlvComman { // There should be an option which should specify a valid reply channel (if there's an empty option the command is invalid) S32 nChannel = 0; - VERIFY_OPTION_REF( (LLStringUtil::convertToS32(strOption, nChannel)) && (rlvIsValidReplyChannel(nChannel)) ); + VERIFY_OPTION_REF( (LLStringUtil::convertToS32(strOption, nChannel)) && (RlvUtil::isValidReplyChannel(nChannel)) ); if (RLV_TYPE_ADD == eType) addException(idObj, eBhvr, nChannel); @@ -1571,7 +1505,7 @@ ERlvCmdRet RlvHandler::processReplyCommand(const LLUUID& idObj, const RlvCommand // Sanity check - <param> should specify a - valid - reply channel S32 nChannel; - if ( (!LLStringUtil::convertToS32(rlvCmd.getParam(), nChannel)) || (!rlvIsValidReplyChannel(nChannel)) ) + if ( (!LLStringUtil::convertToS32(rlvCmd.getParam(), nChannel)) || (!RlvUtil::isValidReplyChannel(nChannel)) ) return RLV_RET_FAILED_PARAM; ERlvCmdRet eRet = RLV_RET_SUCCESS; std::string strReply; @@ -1661,7 +1595,7 @@ ERlvCmdRet RlvHandler::processReplyCommand(const LLUUID& idObj, const RlvCommand // If we made it this far then: // - the command was handled successfully so we send off the response // - the command failed but we still send off an - empty - response to keep the issuing script from blocking - rlvSendChatReply(nChannel, strReply); + RlvUtil::sendChatReply(nChannel, strReply); return eRet; } diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index c0cb5dddfe85552e8879c9758130c6795082e489..5f9008a2ca9ce17d7c4bf0f14840acef80073091 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -95,10 +95,6 @@ public: bool canStand() const; bool canTouch(LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const; // @touch void filterChat(std::string& strUTF8Text, bool fFilterEmote) const; // @sendchat, @recvchat and @redirchat - static void filterLocation(std::string& strUTF8Text); // @showloc - static void filterNames(std::string& strUTF8Text); // @shownames - static bool isNearbyAgent(const LLUUID& idAgent); // @shownames - static bool isNearbyRegion(const std::string& strRegion); // @showloc bool redirectChatOrEmote(const std::string& strUTF8Test) const; // @redirchat and @rediremote // Command processing helper functions diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 6dd06af44e40ec8f6d6ee282934da1e599e4b785..3311344f32544f09c6a24f0928a729c190b5fcc0 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -15,16 +15,13 @@ */ #include "llviewerprecompiledheaders.h" -#include "llagentui.h" #include "llagentwearables.h" #include "llappearancemgr.h" #include "llgesturemgr.h" -#include "llinstantmessage.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" -#include "llviewerstats.h" #include "llwlparammanager.h" #include "rlvhelper.h" @@ -790,7 +787,7 @@ void RlvBehaviourNotifyHandler::onCommand(const LLUUID& idRlvObj, const RlvComma itNotify != m_Notifications.end(); ++itNotify) { if ( (itNotify->second.strFilter.empty()) || (std::string::npos != strCmd.find(itNotify->second.strFilter)) ) - rlvSendChatReply(itNotify->second.nChannel, strNotify); + RlvUtil::sendChatReply(itNotify->second.nChannel, strNotify); } } @@ -869,52 +866,6 @@ bool rlvCanDeleteOrReturn() return fIsAllowed; } -// Checked: 2010-04-08 (RLVa-1.2.0d) | Added: RLVa-1.2.0d -void rlvNotifyFailedAssertion(const char* pstrAssert, const char* pstrFile, int nLine) -{ - LLSD argsNotify; - argsNotify["MESSAGE"] = llformat("RLVa assertion failure: %s (%s - %d)", pstrAssert, pstrFile, nLine); - LLNotificationsUtil::add("SystemMessageTip", argsNotify); -} - -// ========================================================================= -// Message sending functions -// - -// Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b -void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession) -{ - // [See process_improved_im()] - std::string strFullName; - LLAgentUI::buildFullname(strFullName); - - pack_instant_message(gMessageSystem, gAgent.getID(), FALSE, gAgent.getSessionID(), idTo, strFullName, - strMsg, IM_ONLINE, IM_BUSY_AUTO_RESPONSE, idSession); - gAgent.sendReliableMessage(); -} - -// Checked: 2010-03-09 (RLVa-1.2.0a) | Modified: RLVa-1.0.1e -bool rlvSendChatReply(S32 nChannel, const std::string& strReply) -{ - if (!rlvIsValidReplyChannel(nChannel)) - return false; - - // Copy/paste from send_chat_from_viewer() - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ChatFromViewer); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ChatData); - msg->addStringFast(_PREHASH_Message, strReply); - msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_SHOUT); - msg->addS32("Channel", nChannel); - gAgent.sendReliableMessage(); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); - - return true; -} - // ========================================================================= // String helper functions // diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 149d28e40d1669331fa9b92a6c13565fe446361d..26a3c8fcdfe9bc2b38be364545b85661b911b09e 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -305,24 +305,11 @@ public: // bool rlvCanDeleteOrReturn(); -bool rlvIsEmote(const std::string& strUTF8Text); -bool rlvIsValidReplyChannel(S32 nChannel); - -void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null); -bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); -bool rlvSendChatReply(S32 nChannel, const std::string& strReply); std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); void rlvStringReplace(std::string& strText, std::string strFrom, const std::string& strTo); -// ============================================================================ -// Debug helper functions -// - -void rlvDebugFailedAssertion(const char* pstrAssert, const char* pstrFile, int nLine); -void rlvNotifyFailedAssertion(const char* pstrAssert, const char* pstrFile, int nLine); - // ============================================================================ // Inlined class member functions // @@ -368,29 +355,6 @@ inline bool RlvForceWear::isWearableItem(const LLInventoryItem* pItem) (LLAssetType::AT_OBJECT == assetType) || (LLAssetType::AT_GESTURE == assetType); } -// ============================================================================ -// Inlined helper functions -// - -// Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.2a -inline bool rlvIsEmote(const std::string& strUTF8Text) -{ - return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); -} - -// Checked: 2010-03-09 (RLVa-1.2.0b) | Added: RLVa-1.0.2a -inline bool rlvIsValidReplyChannel(S32 nChannel) -{ - return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); -} - -// Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e -inline bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply) -{ - S32 nChannel; - return (LLStringUtil::convertToS32(strChannel, nChannel)) ? rlvSendChatReply(nChannel, strReply) : false; -} - // ============================================================================ #endif // RLV_HELPER_H