aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-14 17:52:41 -0700
committerMcCabe Maxsted2009-09-14 17:52:41 -0700
commit7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd (patch)
tree0243666021de3ae6ac61a6c6f4e57d42771fe964 /linden/indra/newview/llviewermessage.cpp
parentApplied BlockClickSit debug setting from Emerald to block sit click action (diff)
downloadmeta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.zip
meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.gz
meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.bz2
meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.xz
Merged in jacek/next
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 815dc49..e326dac 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)
@@ -1854,6 +1973,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1854 return; 1973 return;
1855 } 1974 }
1856 { 1975 {
1976// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-08 (RLVa-1.0.0e)
1977 // TODO-RLVa: what actually generates this?
1978 if (rlv_handler_t::isEnabled())
1979 {
1980 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1981 gRlvHandler.filterLocation(message);
1982 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
1983 gRlvHandler.filterNames(message);
1984 }
1985// [/RLVa:KB]
1986
1857 // Construct a viewer alert for this message. 1987 // Construct a viewer alert for this message.
1858 args["[NAME]"] = name; 1988 args["[NAME]"] = name;
1859 args["[MESSAGE]"] = message; 1989 args["[MESSAGE]"] = message;
@@ -1886,12 +2016,48 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1886 } 2016 }
1887 else 2017 else
1888 { 2018 {
1889 // *TODO:translate -> [FIRST] [LAST] (maybe) 2019// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d)
1890 LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE); 2020 if (rlv_handler_t::isEnabled())
1891 args["[NAME]"] = name; 2021 {
1892 args["[MESSAGE]"] = message; 2022 // Disallow if: 1) @tplure=n restricted (sender isn't an exception), or 2) @unsit=n restricted and currently sitting
1893 LLNotifyBox::showXml("OfferTeleport", args, 2023 LLVOAvatar* pAvatar = gAgent.getAvatarObject();
1894 lure_callback, (void*)info); 2024 if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) ||
2025 ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) )
2026 {
2027 rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure);
2028 return;
2029 }
2030
2031 // Censor teleport message if: 1) @revcim=n restricted (sender isn't an exception), or 2) @showloc=n restricted
2032 if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) ||
2033 (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
2034 {
2035 message = rlv_handler_t::cstrHidden;
2036 }
2037 }
2038// [/RLVa:KB]
2039
2040// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b
2041 if ( (rlv_handler_t::isEnabled()) &&
2042 ((gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)) || (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id))) )
2043 {
2044 gRlvHandler.setCanCancelTp(false);
2045 // (see IM_GODLIKE_LURE_USER below)
2046 LLLureInfo* info = new LLLureInfo(from_id, session_id, TRUE);
2047 lure_callback(0, (void*)info);
2048 }
2049 else
2050 {
2051// [/RLVa:KB]
2052 // *TODO:translate -> [FIRST] [LAST] (maybe)
2053 LLLureInfo* info = new LLLureInfo(from_id, session_id, FALSE);
2054 args["[NAME]"] = name;
2055 args["[MESSAGE]"] = message;
2056 LLNotifyBox::showXml("OfferTeleport", args,
2057 lure_callback, (void*)info);
2058// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b
2059 }
2060// [/RLVa:KB]
1895 } 2061 }
1896 } 2062 }
1897 break; 2063 break;
@@ -2236,8 +2402,13 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2236 chat.mPosAgent = chatter->getPositionAgent(); 2402 chat.mPosAgent = chatter->getPositionAgent();
2237 2403
2238 // Make swirly things only for talking objects. (not script debug messages, though) 2404 // Make swirly things only for talking objects. (not script debug messages, though)
2239 if (chat.mSourceType == CHAT_SOURCE_OBJECT 2405// if (chat.mSourceType == CHAT_SOURCE_OBJECT
2240 && chat.mChatType != CHAT_TYPE_DEBUG_MSG) 2406// && chat.mChatType != CHAT_TYPE_DEBUG_MSG)
2407// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
2408 // Don't show swirly things for llOwnerSay() chat here because we handle those further down
2409 if ( (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) &&
2410 ((!rlv_handler_t::isEnabled()) || (CHAT_TYPE_OWNER != chat.mChatType)) )
2411// [/RLVa:KB]
2241 { 2412 {
2242 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); 2413 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
2243 psc->setSourceObject(chatter); 2414 psc->setSourceObject(chatter);
@@ -2270,6 +2441,50 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2270 color.setVec(1.f,1.f,1.f,1.f); 2441 color.setVec(1.f,1.f,1.f,1.f);
2271 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); 2442 msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg);
2272 2443
2444// [RLVa:KB] - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d
2445 if ( (rlv_handler_t::isEnabled()) &&
2446 (CHAT_TYPE_START != chat.mChatType) && (CHAT_TYPE_STOP != chat.mChatType) && (CHAT_TYPE_OWNER != chat.mChatType) )
2447 {
2448 // NOTE: chatter can be NULL (may not have rezzed yet, or could be another avie's HUD attachment)
2449 BOOL is_attachment = (chatter) ? chatter->isAttachment() : FALSE;
2450
2451 // Filtering "rules":
2452 // avatar => filter all avie text (unless it's this avie or they're an exemption)
2453 // objects => filter everything except attachments this avie owns
2454 if ( ((CHAT_SOURCE_AGENT == chat.mSourceType) && (from_id != gAgent.getID())) || (!is_owned_by_me) || (!is_attachment) )
2455 {
2456 if (!rlvIsEmote(mesg))
2457 {
2458 if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVCHAT)) && (!gRlvHandler.isException(RLV_BHVR_RECVCHAT, from_id)) )
2459 gRlvHandler.filterChat(mesg, false);
2460 }
2461 else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVEMOTE)) && (!gRlvHandler.isException(RLV_BHVR_RECVEMOTE, from_id)) )
2462 {
2463 mesg = "/me ...";
2464 }
2465 }
2466
2467 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
2468 {
2469 // Filtering "rules":
2470 // avatar => filter only their name (unless it's this avie)
2471 // other => filter everything except attachments this avie owns but then we still do filter their text
2472 if (CHAT_SOURCE_AGENT == chat.mSourceType)
2473 {
2474 if (chat.mFromID != gAgent.getID())
2475 from_name = gRlvHandler.getAnonym(from_name);
2476 }
2477 else
2478 {
2479 if ( (!is_owned_by_me) || (!is_attachment) )
2480 gRlvHandler.filterNames(from_name);
2481 gRlvHandler.filterNames(mesg);
2482 }
2483 chat.mRlvNamesFiltered = true;
2484 }
2485 }
2486// [/RLVa:KB]
2487
2273 BOOL ircstyle = FALSE; 2488 BOOL ircstyle = FALSE;
2274 2489
2275 // Look for IRC-style emotes here so chatbubbles work 2490 // Look for IRC-style emotes here so chatbubbles work
@@ -2334,8 +2549,76 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2334 case CHAT_TYPE_WHISPER: 2549 case CHAT_TYPE_WHISPER:
2335 verb = " " + LLTrans::getString("whisper") + " "; 2550 verb = " " + LLTrans::getString("whisper") + " ";
2336 break; 2551 break;
2337 case CHAT_TYPE_DEBUG_MSG:
2338 case CHAT_TYPE_OWNER: 2552 case CHAT_TYPE_OWNER:
2553// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e
2554 if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) )
2555 {
2556 mesg.erase(0, 1);
2557 LLStringUtil::toLower(mesg);
2558
2559 std::string strExecuted, strFailed, strRetained, *pstr;
2560
2561 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
2562 boost::char_separator<char> sep(",", "", boost::drop_empty_tokens);
2563 tokenizer tokens(mesg, sep);
2564 for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken)
2565 {
2566 if (LLStartUp::getStartupState() == STATE_STARTED)
2567 {
2568 if (gRlvHandler.processCommand(from_id, *itToken, true))
2569 pstr = &strExecuted;
2570 else
2571 pstr = &strFailed;
2572 }
2573 else
2574 {
2575 gRlvHandler.retainCommand(from_name, from_id, *itToken);
2576 pstr = &strRetained;
2577 }
2578
2579 if (!pstr->empty())
2580 pstr->push_back(',');
2581 pstr->append(*itToken);
2582 }
2583
2584 if (!RlvSettings::getDebug())
2585 return;
2586
2587 // Silly people want comprehensive debug messages, blah :p
2588 if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) )
2589 verb = " executes: @";
2590 else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) )
2591 verb = " failed: @";
2592 else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) )
2593 verb = " retained: @";
2594 else
2595 {
2596 verb = ": @";
2597 if (!strExecuted.empty())
2598 mesg += "\n - executed: @" + strExecuted;
2599 if (!strFailed.empty())
2600 mesg += "\n - failed: @" + strFailed;
2601 if (!strRetained.empty())
2602 mesg += "\n - retained: @" + strRetained;
2603 }
2604
2605 break;
2606 }
2607// [/RLVa:KB]
2608// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
2609 // Copy/paste from above
2610 if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) )
2611 {
2612 LLPointer<LLViewerPartSourceChat> psc = new LLViewerPartSourceChat(chatter->getPositionAgent());
2613 psc->setSourceObject(chatter);
2614 psc->setColor(color);
2615 //We set the particles to be owned by the object's owner,
2616 //just in case they should be muted by the mute list
2617 psc->setOwnerUUID(owner_id);
2618 LLViewerPartSim::getInstance()->addPartSource(psc);
2619 }
2620// [/RLVa:KB]
2621 case CHAT_TYPE_DEBUG_MSG:
2339 case CHAT_TYPE_NORMAL: 2622 case CHAT_TYPE_NORMAL:
2340 verb = ": "; 2623 verb = ": ";
2341 break; 2624 break;
@@ -2404,7 +2687,10 @@ void process_teleport_start(LLMessageSystem *msg, void**)
2404 U32 teleport_flags = 0x0; 2687 U32 teleport_flags = 0x0;
2405 msg->getU32("Info", "TeleportFlags", teleport_flags); 2688 msg->getU32("Info", "TeleportFlags", teleport_flags);
2406 2689
2407 if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) 2690 //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
2691// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
2692 if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
2693// [/RLVa:KB]
2408 { 2694 {
2409 gViewerWindow->setProgressCancelButtonVisible(FALSE); 2695 gViewerWindow->setProgressCancelButtonVisible(FALSE);
2410 } 2696 }
@@ -2439,7 +2725,10 @@ void process_teleport_progress(LLMessageSystem* msg, void**)
2439 } 2725 }
2440 U32 teleport_flags = 0x0; 2726 U32 teleport_flags = 0x0;
2441 msg->getU32("Info", "TeleportFlags", teleport_flags); 2727 msg->getU32("Info", "TeleportFlags", teleport_flags);
2442 if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) 2728 //if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL)
2729// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b
2730 if ( (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) || (!gRlvHandler.getCanCancelTp()) )
2731// [/RLVa:KB]
2443 { 2732 {
2444 gViewerWindow->setProgressCancelButtonVisible(FALSE); 2733 gViewerWindow->setProgressCancelButtonVisible(FALSE);
2445 } 2734 }
@@ -2780,7 +3069,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
2780 // know what you look like. 3069 // know what you look like.
2781 gAgent.sendAgentSetAppearance(); 3070 gAgent.sendAgentSetAppearance();
2782 3071
2783 if (avatarp) 3072// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
3073 if ( (avatarp) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
3074// [/RLVa:KB]
3075// if (avatarp)
2784 { 3076 {
2785 // Chat the "back" SLURL. (DEV-4907) 3077 // Chat the "back" SLURL. (DEV-4907)
2786 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL()); 3078 LLChat chat("Teleport completed from " + gAgent.getTeleportSourceSLURL());
@@ -4360,7 +4652,13 @@ void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_q
4360 if (viewregion) 4652 if (viewregion)
4361 { 4653 {
4362 // got the region, so include the region and 3d coordinates of the object 4654 // got the region, so include the region and 3d coordinates of the object
4363 notice.setArg("[REGIONNAME]", viewregion->getName()); 4655 notice.setArg("[REGIONNAME]", viewregion->getName());
4656// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
4657 if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) )
4658 {
4659 notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion);
4660 }
4661// [/RLVa:KB]
4364 std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); 4662 std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]);
4365 notice.setArg("[REGIONPOS]", formatpos); 4663 notice.setArg("[REGIONPOS]", formatpos);
4366 4664
@@ -4565,8 +4863,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
4565 4863
4566 LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name); 4864 LLScriptQuestionCBData *cbdata = new LLScriptQuestionCBData(taskid, itemid, sender, questions, object_name, owner_name);
4567 4865
4866// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0e
4867 S32 rlvQuestionsOther = questions;
4868
4869 if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("acceptpermission")) )
4870 {
4871 LLViewerObject* pObj = gObjectList.findObject(taskid);
4872 if (pObj)
4873 {
4874 if (pObj->permYouOwner())
4875 {
4876 // PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns
4877 rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] |
4878 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]);
4879 }
4880 }
4881 }
4882
4883 if ( (!caution) && (!rlvQuestionsOther) )
4884 {
4885 script_question_cb(0, cbdata);
4886 }
4887 else if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
4888// [/RLVa:KB]
4568 // check whether cautions are even enabled or not 4889 // check whether cautions are even enabled or not
4569 if (gSavedSettings.getBOOL("PermissionsCautionEnabled")) 4890 //if (gSavedSettings.getBOOL("PermissionsCautionEnabled"))
4570 { 4891 {
4571 if (caution) 4892 if (caution)
4572 { 4893 {
@@ -4858,6 +5179,21 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata)
4858 5179
4859 if(0 == option) 5180 if(0 == option)
4860 { 5181 {
5182// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b
5183 bool fRlvCensorMessage = false;
5184 if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
5185 {
5186 for (LLDynamicArray<LLUUID>::iterator it = invitees->begin(); it != invitees->end(); ++it)
5187 {
5188 if (!gRlvHandler.isException(RLV_BHVR_SENDIM, *it))
5189 {
5190 fRlvCensorMessage = true;
5191 break;
5192 }
5193 }
5194 }
5195// [/RLVa:KB]
5196
4861 LLMessageSystem* msg = gMessageSystem; 5197 LLMessageSystem* msg = gMessageSystem;
4862 msg->newMessageFast(_PREHASH_StartLure); 5198 msg->newMessageFast(_PREHASH_StartLure);
4863 msg->nextBlockFast(_PREHASH_AgentData); 5199 msg->nextBlockFast(_PREHASH_AgentData);
@@ -4865,7 +5201,10 @@ void handle_lure_callback(S32 option, const std::string& text, void* userdata)
4865 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 5201 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
4866 msg->nextBlockFast(_PREHASH_Info); 5202 msg->nextBlockFast(_PREHASH_Info);
4867 msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. 5203 msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in.
4868 msg->addStringFast(_PREHASH_Message, text); 5204// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0b
5205 msg->addStringFast(_PREHASH_Message, (!fRlvCensorMessage) ? text : rlv_handler_t::cstrHidden);
5206// [/RLVa:KB]
5207 //msg->addStringFast(_PREHASH_Message, text);
4869 for(LLDynamicArray<LLUUID>::iterator itr = invitees->begin(); itr != invitees->end(); ++itr) 5208 for(LLDynamicArray<LLUUID>::iterator itr = invitees->begin(); itr != invitees->end(); ++itr)
4870 { 5209 {
4871 msg->nextBlockFast(_PREHASH_TargetData); 5210 msg->nextBlockFast(_PREHASH_TargetData);
@@ -4895,8 +5234,28 @@ void handle_lure(LLDynamicArray<LLUUID>& ids)
4895{ 5234{
4896 LLDynamicArray<LLUUID>* userdata = new LLDynamicArray<LLUUID>(ids); 5235 LLDynamicArray<LLUUID>* userdata = new LLDynamicArray<LLUUID>(ids);
4897 5236
5237// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a
5238 // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n
5239 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
5240 {
5241 for (LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); ++it)
5242 {
5243 const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it);
5244 if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it)) &&
5245 ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) )
5246 {
5247 delete userdata;
5248 return;
5249 }
5250 }
5251 }
5252// [/RLVa:KB]
5253
4898 LLStringUtil::format_map_t edit_args; 5254 LLStringUtil::format_map_t edit_args;
4899 edit_args["[REGION]"] = gAgent.getRegion()->getName(); 5255// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-1.0.0a
5256 edit_args["[REGION]"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden;
5257// [/RLVa:KB]
5258 //edit_args["[REGION]"] = gAgent.getRegion()->getName();
4900 if (gAgent.isGodlike()) 5259 if (gAgent.isGodlike())
4901 { 5260 {
4902 gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args, 5261 gViewerWindow->alertXmlEditText("OfferTeleportFromGod", edit_args,