aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-04 01:56:20 -0500
committerJacek Antonelli2009-09-04 03:39:51 -0500
commit89a510de10c48ebcf82b98a962e4bf66477dcc93 (patch)
treed30f79f433badffe36a67fc155e70a0e29dd2dc4 /linden/indra/newview/llviewermessage.cpp
parentBackported 1.23 fix for animation joint assertion crash. (diff)
downloadmeta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.zip
meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.gz
meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.bz2
meta-impy-89a510de10c48ebcf82b98a962e4bf66477dcc93.tar.xz
Applied Kitty Barnett's RLVa 1.0.1h (Restrained Life) patch.
Made a few non-functional changes to help it apply.
Diffstat (limited to 'linden/indra/newview/llviewermessage.cpp')
-rw-r--r--linden/indra/newview/llviewermessage.cpp403
1 files changed, 381 insertions, 22 deletions
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 @@
140#include "llwindebug.h" // For the invalid message handler 140#include "llwindebug.h" // For the invalid message handler
141#endif 141#endif
142 142
143// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
144#include "llfloateravatarinfo.h"
145extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp
146// [/RLVa:KB]
147
143// 148//
144// Constants 149// Constants
145// 150//
@@ -1007,8 +1012,17 @@ void inventory_offer_callback(S32 button, void* user_data)
1007 std::string first_name, last_name; 1012 std::string first_name, last_name;
1008 if (gCacheName->getName(info->mFromID, first_name, last_name)) 1013 if (gCacheName->getName(info->mFromID, first_name, last_name))
1009 { 1014 {
1010 from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name; 1015// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1011 chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name; 1016 std::string full_name = first_name + " " + last_name;
1017 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) )
1018 {
1019 full_name = gRlvHandler.getAnonym(full_name);
1020 }
1021 from_string = std::string("An object named '") + info->mFromName + "' owned by " + full_name;
1022 chatHistory_string = info->mFromName + " owned by " + full_name;
1023// [/RLVa:KB]
1024 //from_string = std::string("An object named '") + info->mFromName + "' owned by " + first_name + " " + last_name;
1025 //chatHistory_string = info->mFromName + " owned by " + first_name + " " + last_name;
1012 } 1026 }
1013 else 1027 else
1014 { 1028 {
@@ -1027,6 +1041,21 @@ void inventory_offer_callback(S32 button, void* user_data)
1027 switch(button) 1041 switch(button)
1028 { 1042 {
1029 case IOR_ACCEPT: 1043 case IOR_ACCEPT:
1044// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.2a
1045 // Only change the inventory offer's destination folder to the shared root if:
1046 // - the user has enabled the feature
1047 // - the inventory offer came from a script (and specifies a folder)
1048 // - the name starts with the prefix [mDesc format (quotes are part of the string): "[OBJECTNAME] ( http://slurl.com/... )"]
1049 if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) &&
1050 (IM_TASK_INVENTORY_OFFERED == info->mIM) && (LLAssetType::AT_CATEGORY == info->mType) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) )
1051 {
1052 LLViewerInventoryCategory* pRlvRoot = gRlvHandler.getSharedRoot();
1053 if (pRlvRoot)
1054 {
1055 info->mFolderID = pRlvRoot->getUUID();
1056 }
1057 }
1058// [/RLVa:KB]
1030 // ACCEPT. The math for the dialog works, because the accept 1059 // ACCEPT. The math for the dialog works, because the accept
1031 // for inventory_offered, task_inventory_offer or 1060 // for inventory_offered, task_inventory_offer or
1032 // group_notice_inventory is 1 greater than the offer integer value. 1061 // group_notice_inventory is 1 greater than the offer integer value.
@@ -1189,6 +1218,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1189 if(indx >= 0) 1218 if(indx >= 0)
1190 { 1219 {
1191 LLStringUtil::truncate(msg, indx); 1220 LLStringUtil::truncate(msg, indx);
1221// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a
1222 // TODO-RLVa: needs revisiting when LL saves open notifications to disk to accept them on the next relog
1223 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1224 {
1225 gRlvHandler.filterLocation(info->mDesc);
1226 }
1227// [/RLVa:KB]
1192 } 1228 }
1193 1229
1194 LLStringUtil::format_map_t args; 1230 LLStringUtil::format_map_t args;
@@ -1229,6 +1265,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1229 std::string first_name, last_name; 1265 std::string first_name, last_name;
1230 if (gCacheName->getName(info->mFromID, first_name, last_name)) 1266 if (gCacheName->getName(info->mFromID, first_name, last_name))
1231 { 1267 {
1268// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1269 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) )
1270 {
1271 first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name));
1272 last_name.clear();
1273 }
1274// [/RLVa:KB]
1232 args["[FIRST]"] = first_name; 1275 args["[FIRST]"] = first_name;
1233 args["[LAST]"] = last_name; 1276 args["[LAST]"] = last_name;
1234 name_found = TRUE; 1277 name_found = TRUE;
@@ -1243,7 +1286,13 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task)
1243 else 1286 else
1244 { 1287 {
1245 // *TODO:translate -> [FIRST] [LAST] 1288 // *TODO:translate -> [FIRST] [LAST]
1246 args["[NAME]"] = info->mFromName; 1289// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1290 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) )
1291 {
1292 args["[NAME]"] = gRlvHandler.getAnonym(info->mFromName);
1293 }
1294// [/RLVa:KB]
1295 //args["[NAME]"] = info->mFromName;
1247 LLNotifyBox::showXml("UserGiveItem", args, 1296 LLNotifyBox::showXml("UserGiveItem", args,
1248 &inventory_offer_callback, (void*)info); 1297 &inventory_offer_callback, (void*)info);
1249 } 1298 }
@@ -1411,7 +1460,20 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1411 // do nothing -- don't distract newbies in 1460 // do nothing -- don't distract newbies in
1412 // Prelude with global IMs 1461 // Prelude with global IMs
1413 } 1462 }
1414 else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) 1463// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
1464 else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) )
1465 {
1466 rlvSendBusyMessage(from_id, gRlvHandler.getVersionString(), session_id);
1467 // We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg)
1468 LLPointer<LLIMInfo> im_info = new LLIMInfo(gMessageSystem);
1469 gIMMgr->processIMTypingStop(im_info);
1470 }
1471// [/RLVa:KB]
1472// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM)
1473// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
1474 else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) &&
1475 ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, from_id))) )
1476// [/RLVa:KB]
1415 { 1477 {
1416 // return a standard "busy" message, but only do it to online IM 1478 // return a standard "busy" message, but only do it to online IM
1417 // (i.e. not other auto responses and not store-and-forward IM) 1479 // (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)
1468 } 1530 }
1469 else if (to_id.isNull()) 1531 else if (to_id.isNull())
1470 { 1532 {
1533// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1534 // Filter region messages that weren't sent by a Linden
1535 if ( (rlv_handler_t::isEnabled()) && (LLMuteList::getInstance()) &&
1536 (!LLMuteList::getInstance()->isLinden(name)) && (from_id != gAgent.getID()) )
1537 {
1538 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1539 gRlvHandler.filterLocation(message);
1540 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
1541 {
1542 name = gRlvHandler.getAnonym(name);
1543 gRlvHandler.filterNames(message);
1544 }
1545 }
1546// [/RLVa:KB]
1547
1471 // Message to everyone from GOD 1548 // Message to everyone from GOD
1472 args["[NAME]"] = name; 1549 args["[NAME]"] = name;
1473 args["[MESSAGE]"] = message; 1550 args["[MESSAGE]"] = message;
@@ -1483,6 +1560,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1483 else 1560 else
1484 { 1561 {
1485 // standard message, not from system 1562 // standard message, not from system
1563// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
1564 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) )
1565 {
1566 rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgRecvIM, session_id);
1567
1568 message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM;
1569 }
1570// [/RLVa:KB]
1571
1486 std::string saved; 1572 std::string saved;
1487 if(offline == IM_OFFLINE) 1573 if(offline == IM_OFFLINE)
1488 { 1574 {
@@ -1688,6 +1774,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1688 bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; 1774 bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0];
1689 info->mType = (LLAssetType::EType) bucketp->asset_type; 1775 info->mType = (LLAssetType::EType) bucketp->asset_type;
1690 info->mObjectID = bucketp->object_id; 1776 info->mObjectID = bucketp->object_id;
1777
1778// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
1779 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) )
1780 {
1781 name = gRlvHandler.getAnonym(name);
1782 }
1783// [/RLVa:KB]
1691 } 1784 }
1692 else 1785 else
1693 { 1786 {
@@ -1732,13 +1825,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1732 1825
1733 case IM_INVENTORY_ACCEPTED: 1826 case IM_INVENTORY_ACCEPTED:
1734 { 1827 {
1735 args["[NAME]"] = name; 1828// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
1829 bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
1830 (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
1831 args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name);
1832// [/RLVa:KB]
1833// args["[NAME]"] = name;
1736 LLNotifyBox::showXml("InventoryAccepted", args); 1834 LLNotifyBox::showXml("InventoryAccepted", args);
1737 break; 1835 break;
1738 } 1836 }
1739 case IM_INVENTORY_DECLINED: 1837 case IM_INVENTORY_DECLINED:
1740 { 1838 {
1741 args["[NAME]"] = name; 1839// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b
1840 bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
1841 (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id));
1842 args["[NAME]"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name);
1843// [/RLVa:KB]
1844// args["[NAME]"] = name;
1742 LLNotifyBox::showXml("InventoryDeclined", args); 1845 LLNotifyBox::showXml("InventoryDeclined", args);
1743 break; 1846 break;
1744 } 1847 }
@@ -1772,6 +1875,22 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1772 return; 1875 return;
1773 } 1876 }
1774 1877
1878// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
1879 if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) )
1880 {
1881 if (gAgent.isInGroup(session_id))
1882 {
1883 if (!gRlvHandler.isException(RLV_BHVR_RECVIM, session_id))
1884 return;
1885 }
1886 else
1887 {
1888 if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) )
1889 message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM;
1890 }
1891 }
1892// [/RLVa:KB]
1893
1775 // standard message, not from system 1894 // standard message, not from system
1776 std::string saved; 1895 std::string saved;
1777 if(offline == IM_OFFLINE) 1896 if(offline == IM_OFFLINE)
@@ -1818,6 +1937,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1818 return; 1937 return;
1819 } 1938 }
1820 { 1939 {
1940// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1941 // TODO-RLVa: what actually generates this?
1942 if (rlv_handler_t::isEnabled())
1943 {
1944 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1945 gRlvHandler.filterLocation(message);
1946 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
1947 gRlvHandler.filterNames(message);
1948 }
1949// [/RLVa:KB]
1950
1821 // Construct a viewer alert for this message. 1951 // Construct a viewer alert for this message.
1822 args["[NAME]"] = name; 1952 args["[NAME]"] = name;
1823 args["[MESSAGE]"] = message; 1953 args["[MESSAGE]"] = message;
@@ -1850,12 +1980,48 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1850 } 1980 }
1851 else 1981 else
1852 { 1982 {
1853 // *TODO:translate -> [FIRST] [LAST] (maybe) 1983// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d)
1854 LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); 1984 if (rlv_handler_t::isEnabled())
1855 args["[NAME]"] = name; 1985 {
1856 args["[MESSAGE]"] = message; 1986 // Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting
1857 LLNotifyBox::showXml("OfferTeleport", args, 1987 LLVOAvatar* pAvatar = gAgent.getAvatarObject();
1858 lure_callback, (void*)info); 1988 if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) ||
1989 ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) )
1990 {
1991 rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure);
1992 return;
1993 }
1994
1995 // Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted
1996 if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) ||
1997 (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
1998 {
1999 message = rlv_handler_t::cstrHidden;
2000 }
2001 }
2002// [/RLVa:KB]
2003
2004// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b
2005 if ( (rlv_handler_t::isEnabled()) &&
2006 ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) )
2007 {
2008 gRlvHandler.setCanCancelTp(false);
2009 // (see IM_GODLIKE_LURE_USER below)
2010 LLLureInfo* info = new LLLureInfo(from_id, session_id, TRUE);
2011 lure_callback(0, (void*)info);
2012 }
2013 else
2014 {
2015// [/RLVa:KB]
2016 // *TODO:translate -> [FIRST] [LAST] (maybe)
2017 LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE);
2018 args["[NAME]"] = name;
2019 args["[MESSAGE]"] = message;
2020 LLNotifyBox::showXml("OfferTeleport", args,
2021 lure_callback, (void*)info);
2022// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b
2023 }
2024// [/RLVa:KB]
1859 } 2025 }
1860 } 2026 }
1861 break; 2027 break;
@@ -2200,8 +2366,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2200 chat.mPosAgent = chatter->getPositionAgent(); 2366 chat.mPosAgent = chatter->getPositionAgent();
2201 2367
2202 // Make swirly things only for talking objects. (not script debug messages, though) 2368 // Make swirly things only for talking objects. (not script debug messages, though)
2203 if (chat.mSourceType == CHAT_SOURCE_OBJECT 2369// if (chat.mSourceType == CHAT_SOURCE_OBJECT
2204 && chat.mChatType != CHAT_TYPE_DEBUG_MSG) 2370// && chat.mChatType != CHAT_TYPE_DEBUG_MSG)
2371// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
2372 // Don't show swirly things for llOwnerSay() chat here because we handle those further down
2373 if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
2374 ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) )
2375// [/RLVa:KB]
2205 { 2376 {
2206 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); 2377 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
2207 psc->setSourceObject(chatter); 2378 psc->setSourceObject(chatter);
@@ -2234,6 +2405,50 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2234 color.setVec(1.f,1.f,1.f,1.f); 2405 color.setVec(1.f,1.f,1.f,1.f);
2235 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); 2406 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg);
2236 2407
2408// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d
2409 if ( (rlv_handler_t::isEnabled()) &&
2410 (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) )
2411 {
2412 // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment)
2413 BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE;
2414
2415 // Filtering "rules":
2416 // avatar => filter all avie text (unless it's this avie or they're an exemption)
2417 // objects => filter everything except attachments this avie owns
2418 if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) )
2419 {
2420 if (!rlvIsEmote(mesg))
2421 {
2422 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) )
2423 gRlvHandler.filterChat(mesg, false);
2424 }
2425 else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) )
2426 {
2427 mesg = "/me ...";
2428 }
2429 }
2430
2431 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
2432 {
2433 // Filtering "rules":
2434 // avatar => filter only their name (unless it's this avie)
2435 // other => filter everything except attachments this avie owns but then we still do filter their text
2436 if (CHAT_SOURCE_AGENT == chat.mSourceType)
2437 {
2438 if (chat.mFromID != gAgent.getID())
2439 from_name = gRlvHandler.getAnonym(from_name);
2440 }
2441 else
2442 {
2443 if ( (!is_owned_by_me) || (!is_attachment) )
2444 gRlvHandler.filterNames(from_name);
2445 gRlvHandler.filterNames(mesg);
2446 }
2447 chat.mRlvNamesFiltered = true;
2448 }
2449 }
2450// [/RLVa:KB]
2451
2237 BOOL ircstyle = FALSE; 2452 BOOL ircstyle = FALSE;
2238 2453
2239 // Look for IRC-style emotes here so chatbubbles work 2454 // Look for IRC-style emotes here so chatbubbles work
@@ -2298,8 +2513,76 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2298 case CHAT_TYPE_WHISPER: 2513 case CHAT_TYPE_WHISPER:
2299 verb = " " + LLTrans::getString("whisper") + " "; 2514 verb = " " + LLTrans::getString("whisper") + " ";
2300 break; 2515 break;
2301 case CHAT_TYPE_DEBUG_MSG:
2302 case CHAT_TYPE_OWNER: 2516 case CHAT_TYPE_OWNER:
2517// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e
2518 if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) )
2519 {
2520 mesg.erase(0, 1);
2521 LLStringUtil::toLower(mesg);
2522
2523 std::string strExecuted, strFailed, strRetained, *pstr;
2524
2525 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
2526 boost::char_separator<char> sep(",", "", boost::drop_empty_tokens);
2527 tokenizer tokens(mesg, sep);
2528 for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken)
2529 {
2530 if (LLStartUp::getStartupState() == STATE_STARTED)
2531 {
2532 if (gRlvHandler.processCommand(from_id, *itToken, true))
2533 pstr = &strExecuted;
2534 else
2535 pstr = &strFailed;
2536 }
2537 else
2538 {
2539 gRlvHandler.retainCommand(from_name, from_id, *itToken);
2540 pstr = &strRetained;
2541 }
2542
2543 if (!pstr->empty())
2544 pstr->push_back(',');
2545 pstr->append(*itToken);
2546 }
2547
2548 if (!RlvSettings::getDebug())
2549 return;
2550
2551 // Silly people want comprehensive debug messages, blah :p
2552 if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) )
2553 verb = " executes: @";
2554 else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) )
2555 verb = " failed: @";
2556 else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) )
2557 verb = " retained: @";
2558 else
2559 {
2560 verb = ": @";
2561 if (!strExecuted.empty())
2562 mesg += "\n - executed: @" + strExecuted;
2563 if (!strFailed.empty())
2564 mesg += "\n - failed: @" + strFailed;
2565 if (!strRetained.empty())
2566 mesg += "\n - retained: @" + strRetained;
2567 }
2568
2569 break;
2570 }
2571// [/RLVa:KB]
2572// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
2573 // Copy/paste from above
2574 if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) )
2575 {
2576 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
2577 psc->setSourceObject(chatter);
2578 psc->setColor(color);
2579 //We set the particles to be owned by the object's owner,
2580 //just in case they should be muted by the mute list
2581 psc->setOwnerUUID(owner_id);
2582 LLViewerPartSim::getInstance()->addPartSource(psc);
2583 }
2584// [/RLVa:KB]
2585 case CHAT_TYPE_DEBUG_MSG:
2303 case CHAT_TYPE_NORMAL: 2586 case CHAT_TYPE_NORMAL:
2304 verb = ": "; 2587 verb = ": ";
2305 break; 2588 break;
@@ -2368,7 +2651,10 @@ void process_teleport_start(LLMessageSystem *msg, void**)
2368 U32 teleport_flags = 0x0; 2651 U32 teleport_flags = 0x0;
2369 msg->getU32("Info", "TeleportFlags", teleport_flags); 2652 msg->getU32("Info", "TeleportFlags", teleport_flags);
2370 2653
2371 if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) 2654 //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
2655// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
2656 if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
2657// [/RLVa:KB]
2372 { 2658 {
2373 gViewerWindow->setProgressCancelButtonVisible(FALSE); 2659 gViewerWindow->setProgressCancelButtonVisible(FALSE);
2374 } 2660 }
@@ -2403,7 +2689,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
2403 } 2689 }
2404 U32 teleport_flags = 0x0; 2690 U32 teleport_flags = 0x0;
2405 msg->getU32("Info", "TeleportFlags", teleport_flags); 2691 msg->getU32("Info", "TeleportFlags", teleport_flags);
2406 if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) 2692 //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
2693// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
2694 if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
2695// [/RLVa:KB]
2407 { 2696 {
2408 gViewerWindow->setProgressCancelButtonVisible(FALSE); 2697 gViewerWindow->setProgressCancelButtonVisible(FALSE);
2409 } 2698 }
@@ -2740,7 +3029,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2740 // know what you look like. 3029 // know what you look like.
2741 gAgent.sendAgentSetAppearance(); 3030 gAgent.sendAgentSetAppearance();
2742 3031
2743 if (avatarp) 3032// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
3033 if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
3034// [/RLVa:KB]
3035// if (avatarp)
2744 { 3036 {
2745 // Chat the "back" SLURL. (DEV-4907) 3037 // Chat the "back" SLURL. (DEV-4907)
2746 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); 3038 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL());
@@ -4320,7 +4612,13 @@ void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_q
4320 if (viewregion) 4612 if (viewregion)
4321 { 4613 {
4322 // got the region, so include the region and 3d coordinates of the object 4614 // got the region, so include the region and 3d coordinates of the object
4323 notice.setArg("[REGIONNAME]", viewregion->getName()); 4615 notice.setArg("[REGIONNAME]", viewregion->getName());
4616// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
4617 if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
4618 {
4619 notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion);
4620 }
4621// [/RLVa:KB]
4324 std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); 4622 std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]);
4325 notice.setArg("[REGIONPOS]", formatpos); 4623 notice.setArg("[REGIONPOS]", formatpos);
4326 4624
@@ -4525,8 +4823,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
4525 4823
4526 LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); 4824 LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name);
4527 4825
4826// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e
4827 S32 rlvQuestionsOther = questions;
4828
4829 if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) )
4830 {
4831 LLViewerObject* pObj = gObjectList.findObject(taskid);
4832 if (pObj)
4833 {
4834 if (pObj->permYouOwner())
4835 {
4836 // PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns
4837 rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] |
4838 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]);
4839 }
4840 }
4841 }
4842
4843 if ( (!caution) && (!rlvQuestionsOther) )
4844 {
4845 script_question_cb(0, cbdata);
4846 }
4847 else if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
4848// [/RLVa:KB]
4528 // check whether cautions are even enabled or not 4849 // check whether cautions are even enabled or not
4529 if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) 4850 //if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
4530 { 4851 {
4531 if (caution) 4852 if (caution)
4532 { 4853 {
@@ -4818,6 +5139,21 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata)
4818 5139
4819 if(0 == option) 5140 if(0 == option)
4820 { 5141 {
5142// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b
5143 bool fRlvCensorMessage = false;
5144 if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
5145 {
5146 for (LLDynamicArray<LLUUID>::iterator it = invitees->begin(); it != invitees->end(); ++it)
5147 {
5148 if (!gRlvHandler.isException(RLV_BHVR_SENDIM, *it))
5149 {
5150 fRlvCensorMessage = true;
5151 break;
5152 }
5153 }
5154 }
5155// [/RLVa:KB]
5156
4821 LLMessageSystem* msg = gMessageSystem; 5157 LLMessageSystem* msg = gMessageSystem;
4822 msg->newMessageFast(_PREHASH_StartLure); 5158 msg->newMessageFast(_PREHASH_StartLure);
4823 msg->nextBlockFast(_PREHASH_AgentData); 5159 msg->nextBlockFast(_PREHASH_AgentData);
@@ -4825,7 +5161,10 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata)
4825 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 5161 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
4826 msg->nextBlockFast(_PREHASH_Info); 5162 msg->nextBlockFast(_PREHASH_Info);
4827 msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. 5163 msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
4828 msg->addStringFast(_PREHASH_Message, text); 5164// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b
5165 msg->addStringFast(_PREHASH_Message, (!fRlvCensorMessage) ? text : rlv_handler_t::cstrHidden);
5166// [/RLVa:KB]
5167 //msg->addStringFast(_PREHASH_Message, text);
4829 for(LLDynamicArray<LLUUID>::iterator itr = invitees->begin(); itr != invitees->end(); ++itr) 5168 for(LLDynamicArray<LLUUID>::iterator itr = invitees->begin(); itr != invitees->end(); ++itr)
4830 { 5169 {
4831 msg->nextBlockFast(_PREHASH_TargetData); 5170 msg->nextBlockFast(_PREHASH_TargetData);
@@ -4855,8 +5194,28 @@ void handle_lure(LLDynamicArray<LLUUID>& ids)
4855{ 5194{
4856 LLDynamicArray<LLUUID>* userdata = new LLDynamicArray<LLUUID>(ids); 5195 LLDynamicArray<LLUUID>* userdata = new LLDynamicArray<LLUUID>(ids);
4857 5196
5197// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a
5198 // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n
5199 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
5200 {
5201 for (LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); ++it)
5202 {
5203 const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it);
5204 if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) &&
5205 ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) )
5206 {
5207 delete userdata;
5208 return;
5209 }
5210 }
5211 }
5212// [/RLVa:KB]
5213
4858 LLStringUtil::format_map_t edit_args; 5214 LLStringUtil::format_map_t edit_args;
4859 edit_args["[REGION]"] = gAgent.getRegion()->getName(); 5215// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a
5216 edit_args["[REGION]"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden;
5217// [/RLVa:KB]
5218 //edit_args["[REGION]"] = gAgent.getRegion()->getName();
4860 if (gAgent.isGodlike()) 5219 if (gAgent.isGodlike())
4861 { 5220 {
4862 gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args, 5221 gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args,