Added @shownames:<uuid> and @shownametags:<uuid> exceptions

-> [FIXED] "Pay" isn't disabled on the avatar context menu when @shownames restricted
  -> [CHANGED] Show a notification when the user can't offer a teleport due to an RLV restriction

--HG--
branch : RLVa
master
Kitty Barnett 2016-06-11 22:45:42 +02:00
parent e90f7a8dad
commit 4b884caf43
39 changed files with 592 additions and 407 deletions

View File

@ -200,17 +200,6 @@
<key>Value</key>
<boolean>1</boolean>
</map>
<key>RLVaShowNameTags</key>
<map>
<key>Comment</key>
<string>Display of names above avatars is subject to the general "Show Names" setting when @shownames=n restricted</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>RLVaTopLevelMenu</key>
<map>
<key>Comment</key>

View File

@ -510,8 +510,8 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
{
LLSD notification;
notification["uuid"] = id;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST)) ? "completename" : "rlvanonym").getSLURLString();
// [RLVa:KB] - Checked: RLVa-1.5.0
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST, id)) ? "completename" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
// LLAvatarName av_name;
// if (!LLAvatarNameCache::get(id, &av_name))

View File

@ -47,9 +47,6 @@
#include "llvoiceclient.h"
#include "llviewercontrol.h" // for gSavedSettings
#include "lltooldraganddrop.h"
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [/RLVa:KB]
static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list");
@ -143,7 +140,7 @@ LLAvatarList::LLAvatarList(const Params& p)
, mShowProfileBtn(p.show_profile_btn)
, mShowSpeakingIndicator(p.show_speaking_indicator)
, mShowPermissions(p.show_permissions_granted)
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
, mRlvCheckShowNames(false)
// [/RLVa:KB]
{
@ -440,7 +437,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info)
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
LLAvatarListItem* item = new LLAvatarListItem();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
item->setRlvCheckShowNames(mRlvCheckShowNames);
// [/RLVa:KB]
// This sets the name as a side effect

View File

@ -91,7 +91,7 @@ public:
// Return true if filter has at least one match.
bool filterHasMatches();
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; }
// We need this to be public since we call it from RlvUIEnabler::onToggleShowNames()
void updateAvatarNames();
@ -132,7 +132,7 @@ private:
bool mShowProfileBtn;
bool mShowSpeakingIndicator;
bool mShowPermissions;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - RLVa-1.2.0
bool mRlvCheckShowNames;
// [/RLVa:KB]

View File

@ -41,8 +41,9 @@
#include "llavatariconctrl.h"
#include "lloutputmonitorctrl.h"
#include "lltooldraganddrop.h"
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
bool LLAvatarListItem::sStaticInitialized = false;
@ -79,7 +80,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
mOnlineStatus(E_UNKNOWN),
mShowInfoBtn(true),
mShowProfileBtn(true),
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
mRlvCheckShowNames(false),
// [/RLVa:KB]
mShowPermissions(false),
@ -185,9 +186,10 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
getChildView("hovered_icon")->setVisible( true);
// mInfoBtn->setVisible(mShowInfoBtn);
// mProfileBtn->setVisible(mShowProfileBtn);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
mProfileBtn->setVisible( (mShowProfileBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) );
// [RLVa:KB] - Checked: RLVa-1.2.0
bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId));
mInfoBtn->setVisible( (mShowInfoBtn) && (fRlvCanShowName) );
mProfileBtn->setVisible( (mShowProfileBtn) && (fRlvCanShowName) );
// [/RLVa:KB]
mHovered = true;
@ -366,7 +368,7 @@ void LLAvatarListItem::onProfileBtnClick()
BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask)
{
// if(mInfoBtn->getRect().pointInRect(x, y))
// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// [RVLa:KB] - Checked: RLVa-1.2.2
if ( (mInfoBtn->getVisible()) && (mInfoBtn->getEnabled()) && (mInfoBtn->getRect().pointInRect(x, y)) )
// [/SL:KB]
{
@ -374,7 +376,7 @@ BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask)
return TRUE;
}
// if(mProfileBtn->getRect().pointInRect(x, y))
// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (mProfileBtn->getVisible()) && (mProfileBtn->getEnabled()) && (mProfileBtn->getRect().pointInRect(x, y)) )
// [/SL:KB]
{
@ -424,12 +426,13 @@ void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name)
// setAvatarName(av_name.getDisplayName());
// setAvatarToolTip(av_name.getUserName());
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
setAvatarName( (!fRlvFilter) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) );
setAvatarToolTip( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) );
// [RLVa:KB] - Checked: RLVa-1.2.2
bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId));
setAvatarName( (fRlvCanShowName) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) );
setAvatarToolTip( (fRlvCanShowName) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) );
// TODO-RLVa: bit of a hack putting this here. Maybe find a better way?
mAvatarIcon->setDrawTooltip(!fRlvFilter);
mAvatarIcon->setDrawTooltip(fRlvCanShowName);
// [/RLVa:KB]
//requesting the list to resort

View File

@ -106,7 +106,7 @@ public:
void setShowPermissions(bool show) { mShowPermissions = show; };
void showLastInteractionTime(bool show);
void setAvatarIconVisible(bool visible);
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; }
// [/RLVa:KB]
@ -214,7 +214,7 @@ private:
//Speaker indicator and avatar name coords are translated accordingly
bool mShowInfoBtn;
bool mShowProfileBtn;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
bool mRlvCheckShowNames;
// [/RLVa:KB]

View File

@ -292,6 +292,7 @@ void LLFloaterAvatarPicker::onList()
RLV_ASSERT( (pTabs) && (pNearMePanel) );
if ( (pTabs) && (pNearMePanel) )
{
// TODO-RLVa: check this for RlvActions::canShowName()
bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable);
if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) )

View File

@ -45,8 +45,9 @@
#include "llrootview.h"
#include "lllayoutstack.h"
// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.0
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
//add LLFloaterIMNearbyChatHandler to LLNotificationsUI namespace
@ -491,16 +492,16 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
return;//don't process empty messages
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
if (rlv_handler_t::isEnabled())
if (RlvActions::isRlvEnabled())
{
// NOTE-RLVa: we can only filter the *message* here since most everything else will already be part of "args" as well
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
if ( (!RlvActions::canShowLocation()) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
{
RlvUtil::filterLocation(tmp_chat.mText);
tmp_chat.mRlvLocFiltered = TRUE;
}
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) )
{
RlvUtil::filterNames(tmp_chat.mText);
tmp_chat.mRlvNamesFiltered = TRUE;
@ -574,8 +575,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
LLFirstUse::otherAvatarChatFirst();
// Add sender to the recent people list.
// [RLVa:KB] - Checked: 2012-03-15 (RLVa-1.4.6) | Added: RLVa-1.4.6
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-2.0.0
if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, chat_msg.mFromID)) )
LLRecentPeople::instance().add(chat_msg.mFromID);
// [/RLVa:KB]
// LLRecentPeople::instance().add(chat_msg.mFromID);
@ -651,8 +652,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
LLUUID id;
id.generate();
chat["id"] = id;
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if (rlv_handler_t::isEnabled())
// [RLVa:KB] - Checked: RLVa-1.2.0
if (RlvActions::isRlvEnabled())
chat["show_icon_tooltip"] = !chat_msg.mRlvNamesFiltered;
// [/RLVa:KB]
std::string r_color_name = "White";

View File

@ -42,9 +42,10 @@
#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvhandler.h"
#include "llagent.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
#include "rlvui.h"
// [/RLVa:KB]
//LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
@ -105,11 +106,13 @@ void LLFloaterInspect::onOpen(const LLSD& key)
mObjectSelection = LLSelectMgr::getInstance()->getSelection();
refresh();
}
void LLFloaterInspect::onClickCreatorProfile()
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLSelectNode* LLFloaterInspect::getSelectedNode() /*const*/
{
if(mObjectList->getAllSelected().size() == 0)
{
return;
return NULL;
}
LLScrollListItem* first_selected =mObjectList->getFirstSelected();
@ -124,41 +127,29 @@ void LLFloaterInspect::onClickCreatorProfile()
return (obj_id == node->getObject()->getID());
}
} func(first_selected->getUUID());
LLSelectNode* node = mObjectSelection->getFirstNode(&func);
return mObjectSelection->getFirstNode(&func);
}
return NULL;
}
void LLFloaterInspect::onClickCreatorProfile()
{
const LLSelectNode* node = getSelectedNode();
if(node)
{
// LLAvatarActions::showProfile(node->mPermissions->getCreator());
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
// Only anonymize the creator if they're also the owner or if they're a nearby avie
const LLUUID& idCreator = node->mPermissions->getCreator();
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) && ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) )
{
return;
}
LLAvatarActions::showProfile(idCreator);
// [/RLVa:KB]
}
}
}
void LLFloaterInspect::onClickOwnerProfile()
{
if(mObjectList->getAllSelected().size() == 0) return;
LLScrollListItem* first_selected =mObjectList->getFirstSelected();
if (first_selected)
{
LLUUID selected_id = first_selected->getUUID();
struct f : public LLSelectedNodeFunctor
{
LLUUID obj_id;
f(const LLUUID& id) : obj_id(id) {}
virtual bool apply(LLSelectNode* node)
{
return (obj_id == node->getObject()->getID());
}
} func(selected_id);
LLSelectNode* node = mObjectSelection->getFirstNode(&func);
const LLSelectNode* node = getSelectedNode();
if(node)
{
if(node->mPermissions->isGroupOwned())
@ -169,30 +160,108 @@ void LLFloaterInspect::onClickOwnerProfile()
else
{
const LLUUID& owner_id = node->mPermissions->getOwner();
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
return;
// [/RLVa:KB]
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id))
return;
LLAvatarActions::showProfile(owner_id);
}
}
}
}
void LLFloaterInspect::onSelectObject()
{
if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
{
// getChildView("button owner")->setEnabled(true);
// getChildView("button creator")->setEnabled(true);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// TODO-RLVa: [RLVa-1.2.2] Is it worth checking the selected node just to selectively disable this button?
getChildView("button creator")->setEnabled(true);
// [/RLVa:KB]
if (!RlvActions::isRlvEnabled())
{
getChildView("button owner")->setEnabled(true);
getChildView("button creator")->setEnabled(true);
}
else
{
const LLSelectNode* node = getSelectedNode();
const LLUUID& idOwner = (node) ? node->mPermissions->getOwner() : LLUUID::null;
const LLUUID& idCreator = (node) ? node->mPermissions->getCreator() : LLUUID::null;
// See LLFloaterInspect::onClickCreatorProfile()
getChildView("button owner")->setEnabled( (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || ((node) && (node->mPermissions->isGroupOwned())) );
// See LLFloaterInspect::onClickOwnerProfile()
getChildView("button creator")->setEnabled( ((idOwner != idCreator) && (!RlvUtil::isNearbyAgent(idCreator))) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) );
}
}
}
// [/RLVa:KB]
//void LLFloaterInspect::onClickCreatorProfile()
//{
// if(mObjectList->getAllSelected().size() == 0)
// {
// return;
// }
// LLScrollListItem* first_selected =mObjectList->getFirstSelected();
//
// if (first_selected)
// {
// struct f : public LLSelectedNodeFunctor
// {
// LLUUID obj_id;
// f(const LLUUID& id) : obj_id(id) {}
// virtual bool apply(LLSelectNode* node)
// {
// return (obj_id == node->getObject()->getID());
// }
// } func(first_selected->getUUID());
// LLSelectNode* node = mObjectSelection->getFirstNode(&func);
// if(node)
// {
// LLAvatarActions::showProfile(node->mPermissions->getCreator());
// }
// }
//}
//void LLFloaterInspect::onClickOwnerProfile()
//{
// if(mObjectList->getAllSelected().size() == 0) return;
// LLScrollListItem* first_selected =mObjectList->getFirstSelected();
//
// if (first_selected)
// {
// LLUUID selected_id = first_selected->getUUID();
// struct f : public LLSelectedNodeFunctor
// {
// LLUUID obj_id;
// f(const LLUUID& id) : obj_id(id) {}
// virtual bool apply(LLSelectNode* node)
// {
// return (obj_id == node->getObject()->getID());
// }
// } func(selected_id);
// LLSelectNode* node = mObjectSelection->getFirstNode(&func);
// if(node)
// {
// if(node->mPermissions->isGroupOwned())
// {
// const LLUUID& idGroup = node->mPermissions->getGroup();
// LLGroupActions::show(idGroup);
// }
// else
// {
// const LLUUID& owner_id = node->mPermissions->getOwner();
// LLAvatarActions::showProfile(owner_id);
// }
//
// }
// }
//}
//void LLFloaterInspect::onSelectObject()
//{
// if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
// {
// getChildView("button owner")->setEnabled(true);
// getChildView("button creator")->setEnabled(true);
// }
//}
LLUUID LLFloaterInspect::getSelectedUUID()
{
@ -276,12 +345,11 @@ void LLFloaterInspect::refresh()
// actual name and set a placeholder.
if (LLAvatarNameCache::get(idOwner, &av_name))
{
// owner_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) &&
(!obj->mPermissions->isGroupOwned());
owner_name = (!fRlvFilterOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || (obj->mPermissions->isGroupOwned());
owner_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
// owner_name = av_name.getCompleteName();
}
else
{
@ -296,14 +364,12 @@ void LLFloaterInspect::refresh()
if (LLAvatarNameCache::get(idCreator, &av_name))
{
// creator_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLUUID& idCreator = obj->mPermissions->getCreator();
LLAvatarNameCache::get(idCreator, &av_name);
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) &&
( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (!fRlvFilterCreator) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) || ( (obj->mPermissions->getOwner() != idCreator) && (!RlvUtil::isNearbyAgent(idCreator)) );
creator_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
// creator_name = av_name.getCompleteName();
}
else
{
@ -314,7 +380,7 @@ void LLFloaterInspect::refresh()
}
mCreatorNameCacheConnection = LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetCreatorNameCallback, this));
}
row["id"] = obj->getObject()->getID();
row["columns"][0]["column"] = "object_name";
row["columns"][0]["type"] = "text";

View File

@ -36,6 +36,9 @@
class LLObjectSelection;
class LLScrollListCtrl;
class LLUICtrl;
// [RLVa:KB] - Checked: RLVa-2.0.1
class LLSelectNode;
// [/RLVa:KB]
class LLFloaterInspect : public LLFloater
{
@ -61,6 +64,10 @@ protected:
void setDirty() { mDirty = TRUE; }
bool mDirty;
// [RLVa:KB] - Checked: RLVa-2.0.1
const LLSelectNode* getSelectedNode() /*const*/;
// [/RLVa:KB]
private:
void onGetOwnerNameCallback();
void onGetCreatorNameCallback();

View File

@ -59,8 +59,9 @@
#include "lluictrlfactory.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -282,11 +283,10 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
getChildView("BtnCreator")->setEnabled(TRUE);
getChildView("LabelCreatorTitle")->setEnabled(TRUE);
getChildView("LabelCreatorName")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e
// [RLVa:KB] - Checked: RLVa-2.0.1
// If the object creator matches the object owner we need to anonymize the creator field as well
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getCreatorUUID())) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
{
childSetEnabled("BtnCreator", FALSE);
name = RlvStrings::getAnonym(name);
@ -307,6 +307,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
////////////////
if(perm.isOwned())
{
// [RLVa:KB] - Checked: RVLa-2.0.1
bool fRlvCanShowOwner = true;
// [/RLVa:KB]
std::string name;
if (perm.isGroupOwned())
{
@ -315,14 +318,18 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
else
{
gCacheName->getFullName(perm.getOwner(), name);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
name = RlvStrings::getAnonym(name);
// [RLVa:KB] - Checked: RLVa-2.0.1
if (RlvActions::isRlvEnabled())
{
fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, perm.getOwner());
if (!fRlvCanShowOwner)
name = RlvStrings::getAnonym(name);
}
// [/RLVa:KB]
}
// getChildView("BtnOwner")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e
getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-2.0.1
getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner);
// [/RLVa:KB]
getChildView("LabelOwnerTitle")->setEnabled(TRUE);
getChildView("LabelOwnerName")->setEnabled(TRUE);
@ -560,12 +567,12 @@ void LLFloaterProperties::onClickCreator()
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-1.2.1
const LLUUID& idCreator = item->getCreatorUUID();
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) )
{
const LLPermissions& perm = item->getPermissions();
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) )
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) )
{
return;
}
@ -586,8 +593,8 @@ void LLFloaterProperties::onClickOwner()
}
else
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-1.0.0
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) )
return;
// [/RLVa:KB]
LLAvatarActions::showProfile(item->getPermissions().getOwner());

View File

@ -46,9 +46,10 @@
#include "llrecentpeople.h"
#include "llviewerobjectlist.h"
#include "llvoavatarself.h"
// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.2a)
// [RLVa:KB] - Checked: RLVa-1.2.2
#include "llavatarnamecache.h"
#include "rlvhandler.h"
#include "rlvactions.h"
#include "rlvcommon.h"
#include "rlvui.h"
// [/RLVa:KB]
@ -322,9 +323,8 @@ 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.2a) | Modified: RLVa-1.2.0h
else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) &&
(!RlvUIEnabler::hasOpenProfile(to_agent)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
else if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) && (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
std::string strMsgName = "inventory_item_offered-im"; LLSD args; LLAvatarName avName;
@ -444,10 +444,10 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent,
// add buddy to recent people list
// LLRecentPeople::instance().add(to_agent);
// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// [RLVa:KB] - Checked: RLVa-2.0.0
// 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()) || (!RlvUtil::isNearbyAgent(to_agent)) ||
(RlvUIEnabler::hasOpenProfile(to_agent)) )
if ( (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) )
{
LLRecentPeople::instance().add(to_agent);
}
@ -518,10 +518,10 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
// add buddy to recent people list
// LLRecentPeople::instance().add(to_agent);
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// [RLVa:KB] - Checked: RLVa-2.0.0
// 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()) || (!RlvUtil::isNearbyAgent(to_agent)) ||
(RlvUIEnabler::hasOpenProfile(to_agent)) )
if ( (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) )
{
LLRecentPeople::instance().add(to_agent);
}

View File

@ -46,7 +46,8 @@
#include "llstatusbar.h"
#include "llmenugl.h"
#include "pipeline.h"
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a)
// [RLVa:KB] - Checked: RLVa-1.4.0
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/tokenizer.hpp>
@ -247,14 +248,14 @@ void LLHUDText::setString(const std::string &text_utf8)
// addLine(text_utf8, mColor);
// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f
// NOTE: setString() is called for debug and map beacons as well
if (rlv_handler_t::isEnabled())
if (RlvActions::isRlvEnabled())
{
std::string text(text_utf8);
if (gRlvHandler.canShowHoverText(mSourceObject))
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(text);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(text);
}
else

View File

@ -502,12 +502,10 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep)
LLUUID creator_id = nodep->mPermissions->getCreator();
// std::string creator_url =
// LLSLURL("agent", creator_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize the creator if they're also the owner or if they're a nearby avie
bool fRlvHideCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id)));
std::string creator_url =
LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString();
bool fRlvHideCreator = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) && ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id)));
const std::string creator_url = LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
args["[CREATOR]"] = creator_url;
@ -524,8 +522,8 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep)
{
owner_id = nodep->mPermissions->getOwner();
// owner_url = LLSLURL("agent", owner_id, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvHideOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-1.2.2
bool fRlvHideOwner = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id));
owner_url = LLSLURL("agent", owner_id, (!fRlvHideOwner) ? "about" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
}

View File

@ -60,8 +60,9 @@
#include "llviewerwindow.h"
#include "llworld.h"
#include "llworldmapview.h" // shared draw code
// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
static LLDefaultChildRegistry::Register<LLNetMap> r1("net_map");
@ -351,9 +352,8 @@ void LLNetMap::draw()
pos_map = globalPosToView(positions[i]);
// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL) &&
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-1.2.0
bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, uuid));
// [/RLVa:KB]
// bool show_as_friend = (LLAvatarTracker::instance().getBuddyInfo(uuid) != NULL);
@ -608,26 +608,17 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
// If the cursor is near an avatar on the minimap, a mini-inspector will be
// shown for the avatar, instead of the normal map tooltip.
// if (handleToolTipAgent(mClosestAgentToCursor))
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (handleToolTipAgent(mClosestAgentToCursor)) )
// [RLVa:KB] - Checked: RLVa-1.2.2
bool fRlvCanShowName = (mClosestAgentToCursor.notNull()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mClosestAgentToCursor));
if ( (fRlvCanShowName) && (handleToolTipAgent(mClosestAgentToCursor)) )
// [/RLVa:KB]
{
return TRUE;
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
LLStringUtil::format_map_t args;
LLAvatarName avName;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
(mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) )
{
args["[AGENT]"] = RlvStrings::getAnonym(avName) + "\n";
}
else
{
args["[AGENT]"] = "";
}
// [RLVa:KB] - Checked: RLVa-1.2.2
LLStringUtil::format_map_t args; LLAvatarName avName;
args["[AGENT]"] = ( (!fRlvCanShowName) && (mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) ) ? RlvStrings::getAnonym(avName) + "\n" : "";
// [/RLVa:KB]
LLRect sticky_rect;
@ -642,8 +633,8 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP;
// region_name = region->getName();
// [RLVa:KB] - Checked: 2010-10-19 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b
region_name = ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
// [RLVa:KB] - Checked: RLVa-1.2.2
region_name = (RlvActions::canShowLocation()) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION);
// [/RLVa:KB]
if (!region_name.empty())
{

View File

@ -74,8 +74,8 @@
#include "llagentui.h"
#include "llslurl.h"
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-1.2.2
#include "rlvactions.h"
// [/RLVa:KB]
@ -626,7 +626,7 @@ BOOL LLPanelPeople::postBuild()
mNearbyList->setNoItemsMsg(getString("no_one_near"));
mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near"));
mNearbyList->setShowIcons("NearbyListShowIcons");
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
mNearbyList->setRlvCheckShowNames(true);
// [/RLVa:KB]
mMiniMap = (LLNetMap*)getChildView("Net Map",true);
@ -898,7 +898,7 @@ void LLPanelPeople::updateFacebookList(bool visible)
void LLPanelPeople::updateButtons()
{
std::string cur_tab = getActiveTabName();
// [RLVa:KB] - Checked: 2013-05-06 (RLVa-1.4.9)
// [RLVa:KB] - Checked: RLVa-1.4.9
bool nearby_tab_active = (cur_tab == NEARBY_TAB_NAME);
// [/RLVa:KB]
bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME);
@ -941,9 +941,9 @@ void LLPanelPeople::updateButtons()
LLPanel* cur_panel = mTabContainer->getCurrentPanel();
if (cur_panel)
{
// [RLVa:KB] - Checked: 2010-07-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0h
// [RLVa:KB] - Checked: RLVa-1.2.0
if (cur_panel->hasChild("add_friend_btn", TRUE))
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && ((!nearby_tab_active) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))));
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && ((!nearby_tab_active) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, selected_id))));
// [/RLBa:KB]
// if (cur_panel->hasChild("add_friend_btn", TRUE))
// cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self);
@ -960,10 +960,13 @@ void LLPanelPeople::updateButtons()
}
}
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d
if ( (nearby_tab_active) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (nearby_tab_active) && (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
item_selected = multiple_selected = false;
bool fCanShowNames = true;
std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fCanShowNames)
item_selected = multiple_selected = false;
}
// [/RLBa:KB]
}
@ -1164,13 +1167,6 @@ void LLPanelPeople::onTabSelected(const LLSD& param)
void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (NEARBY_TAB_NAME == getActiveTabName()) )
{
return;
}
// [/RLVa:KB]
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(ctrl);
if(!item)
{
@ -1183,6 +1179,13 @@ void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
return;
}
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, clicked_id)) )
{
return;
}
// [/RLVa:KB]
#if 0 // SJB: Useful for testing, but not currently functional or to spec
LLAvatarActions::showProfile(clicked_id);
#else // spec says open IM window
@ -1296,15 +1299,17 @@ void LLPanelPeople::onGearButtonClicked(LLUICtrl* btn)
void LLPanelPeople::onImButtonClicked()
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (NEARBY_TAB_NAME == getActiveTabName()) )
{
return;
}
// [/RLVa:KB]
uuid_vec_t selected_uuids;
getCurrentItemIDs(selected_uuids);
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
bool fCanShowNames = true;
std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fCanShowNames)
return;
}
// [/RLVa:KB]
if ( selected_uuids.size() == 1 )
{
// if selected only one person then start up IM

View File

@ -59,7 +59,7 @@ public:
bool mTryToConnectToFacebook;
// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
// [RLVa:KB] - Checked: RLVa-1.2.0
LLAvatarList* getNearbyList() { return mNearbyList; }
// [/RLVa:KB]

View File

@ -41,9 +41,8 @@
#include "llviewermenu.h" // for gMenuHolder
#include "llconversationmodel.h"
#include "llviewerobjectlist.h"
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
namespace LLPanelPeopleMenus
@ -184,17 +183,17 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
for (;id != uuids_end; ++id)
{
if ( LLAvatarActions::isFriend(*id) )
// if ( LLAvatarActions::isFriend(*id) )
// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1)
if ( (LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) )
// [/RLVa:KB]
{
result = false;
break;
}
}
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
return result && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
// return result;
return result;
}
else if (item == std::string("can_delete"))
{
@ -210,17 +209,17 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
for (;id != uuids_end; ++id)
{
if ( !LLAvatarActions::isFriend(*id) )
// if ( !LLAvatarActions::isFriend(*id) )
// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1)
if ( (!LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) )
// [/RLVa:KB]
{
result = false;
break;
}
}
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
return result && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
// return result;
return result;
}
else if (item == std::string("can_call"))
{
@ -272,8 +271,8 @@ void PeopleContextMenu::requestTeleport()
{
// boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(),
// so we have to use a wrapper.
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
bool fRlvCanShowName = (!m_fRlvCheck) || (!RlvActions::isRlvEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (!m_fRlvCheck) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mUUIDs.front()));
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, fRlvCanShowName);
LLAvatarActions::teleportRequest(mUUIDs.front());
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, true);
@ -285,8 +284,11 @@ void PeopleContextMenu::offerTeleport()
{
// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
// so we have to use a wrapper.
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
bool fRlvCanShowName = (!m_fRlvCheck) || (!RlvActions::isRlvEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = true;
if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) )
std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, fRlvCanShowName);
LLAvatarActions::offerTeleport(mUUIDs);
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, true);
@ -314,14 +316,18 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-1.5.0
bool fRlvCanShowName = true;
if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) )
std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); });
if (!fRlvCanShowName)
{
if (flags & ITEM_IN_MULTI_SELECTION)
{
items.push_back(std::string("offer_teleport"));
}
else
else
{
items.push_back(std::string("offer_teleport"));
items.push_back(std::string("request_teleport"));

View File

@ -38,7 +38,7 @@ namespace LLPanelPeopleMenus
class PeopleContextMenu : public LLListContextMenu
{
public:
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
// [RLVa:KB] - Checked: RLVa-1.5.0
PeopleContextMenu() : m_fRlvCheck(false) {}
// [/RLVa:KB]
/*virtual*/ LLContextMenu* createMenu();
@ -53,7 +53,7 @@ private:
void startConference();
void requestTeleport();
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
// [RLVa:KB] - Checked: RLVa-1.5.0
protected:
bool m_fRlvCheck;
// [/RLVa:KB]
@ -64,7 +64,7 @@ protected:
*/
class NearbyPeopleContextMenu : public PeopleContextMenu
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
// [RLVa:KB] - Checked: RLVa-1.5.0
public:
NearbyPeopleContextMenu() : PeopleContextMenu() { m_fRlvCheck = true; }
// [/RLVa:KB]

View File

@ -65,7 +65,8 @@
#include "lltrans.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a)
#include "llslurl.h"
#include "rlvhandler.h"
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
U8 string_value_to_click_action(std::string p_value);
@ -411,15 +412,15 @@ void LLPanelPermissions::refresh()
// getChildView("Owner Name")->setEnabled(TRUE);
// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-2.0.1
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) )
{
// Only anonymize 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 != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
if ( (creators_identical) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mCreatorID)) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) )
creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString();
// Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned
if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) )
if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mOwnerID)) )
owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString();
}

View File

@ -47,8 +47,9 @@
#include "llexperienceassociationresponder.h"
#include "llexperiencecache.h"
#include "lltrans.h"
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a)
#include "rlvhandler.h"
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvcommon.h"
// [/RLVa:KB]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -360,13 +361,16 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
// std::string name =
// LLSLURL("agent", creator_id, "completename").getSLURLString();
// getChildView("BtnCreator")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
// If the object creator matches the object owner we need to anonymize the creator field as well
bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) && (perm.getOwner() != gAgent.getID())) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) );
std::string name = LLSLURL("agent", creator_id, (!fRlvFilterCreator) ? "completename" : "rlvanonym").getSLURLString();
getChildView("BtnCreator")->setEnabled(!fRlvFilterCreator);
bool fRlvCanShowCreator = true;
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) &&
( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) )
{
fRlvCanShowCreator = false;
}
std::string name = LLSLURL("agent", creator_id, (fRlvCanShowCreator) ? "completename" : "rlvanonym").getSLURLString();
getChildView("BtnCreator")->setEnabled(fRlvCanShowCreator);
// [/RLVa:KB]
getChildView("LabelCreatorTitle")->setEnabled(TRUE);
getChildView("LabelCreatorName")->setEnabled(FALSE);
@ -385,6 +389,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
////////////////
if(perm.isOwned())
{
// [RLVa:KB] - Checked: RVLa-2.0.1
bool fRlvCanShowOwner = true;
// [/RLVa:KB]
std::string name;
if (perm.isGroupOwned())
{
@ -394,14 +401,14 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
{
LLUUID owner_id = perm.getOwner();
// name = LLSLURL("agent", owner_id, "completename").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (owner_id != gAgent.getID());
name = LLSLURL("agent", owner_id, (!fRlvFilterOwner) ? "completename" : "rlvanonym").getSLURLString();
// [RLVa:KB] - Checked: RLVa-2.0.1
fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id);
name = LLSLURL("agent", owner_id, (fRlvCanShowOwner) ? "completename" : "rlvanonym").getSLURLString();
// [/RLVa:KB]
}
// getChildView("BtnOwner")->setEnabled(TRUE);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.0.0e
getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-2.0.1
getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner);
// [/RLVa:KB]
getChildView("LabelOwnerTitle")->setEnabled(TRUE);
getChildView("LabelOwnerName")->setEnabled(FALSE);
@ -759,12 +766,12 @@ void LLSidepanelItemInfo::onClickCreator()
if(!item) return;
if(!item->getCreatorUUID().isNull())
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.2.1b
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
// [RLVa:KB] - Checked: RLVa-1.2.1
const LLUUID& idCreator = item->getCreatorUUID();
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) )
{
const LLPermissions& perm = item->getPermissions();
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) && (perm.getOwner() != gAgent.getID())) ||
(RlvUtil::isNearbyAgent(item->getCreatorUUID())) )
if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) )
{
return;
}
@ -785,8 +792,8 @@ void LLSidepanelItemInfo::onClickOwner()
}
else
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (item->getPermissions().getOwner() != gAgent.getID()) )
// [RLVa:KB] - Checked: RLVa-1.0.0
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) )
return;
// [/RLVa:KB]
LLAvatarActions::showProfile(item->getPermissions().getOwner());

View File

@ -1123,8 +1123,8 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
if (LLAvatarNameCache::get(hover_object->getID(), &av_name))
{
// final_name = av_name.getCompleteName();
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
final_name = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [RLVa:KB] - Checked: RLVa-1.2.2
final_name = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
}
else
@ -1134,9 +1134,9 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
// *HACK: We may select this object, so pretend it was clicked
mPick = mHoverPick;
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.2a) | Added: RLVa-1.2.0e
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (!rlv_handler_t::isEnabled()) ||
( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) )
( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ) )
{
// [/RLVa:KB]
LLInspector::Params p;

View File

@ -3097,8 +3097,8 @@ bool enable_object_mute()
lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden");
bool is_self = avatar->isSelf();
// return !is_linden && !is_self;
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
return !is_linden && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// [RLVa:KB] - Checked: RLVa-1.2.1
return !is_linden && !is_self && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
}
else
@ -3206,11 +3206,11 @@ class LLObjectMute : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(object);
if (avatar)
{
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
id = avatar->getID();
// [RLVa:KB] - Checked: RLVa-1.0.0
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, id))
return true;
// [/RLVa:KB]
id = avatar->getID();
LLNameValue *firstname = avatar->getNVPair("FirstName");
LLNameValue *lastname = avatar->getNVPair("LastName");
@ -3364,8 +3364,8 @@ void handle_avatar_freeze(const LLSD& avatar_id)
{
LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
LLNotificationsUtil::add("FreezeAvatarFullname",
args,
@ -3496,8 +3496,8 @@ void handle_avatar_eject(const LLSD& avatar_id)
{
LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
LLNotificationsUtil::add("EjectAvatarFullname",
args,
@ -3519,8 +3519,8 @@ void handle_avatar_eject(const LLSD& avatar_id)
{
LLSD args;
// args["AVATAR_NAME"] = fullname;
// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e
args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname);
// [RLVa:KB] - Checked: RLVa-1.0.0
args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname);
// [/RLVa:KB]
LLNotificationsUtil::add("EjectAvatarFullnameNoBan",
args,
@ -4017,8 +4017,8 @@ class LLAvatarEnableAddFriend : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
// bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID());
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-1.2.0
bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
return new_value;
}
@ -6154,8 +6154,8 @@ class LLAvatarInviteToGroup : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar)
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::inviteToGroup(avatar->getID());
@ -6170,8 +6170,8 @@ class LLAvatarAddFriend : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar && !LLAvatarActions::isFriend(avatar->getID()))
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
request_friendship(avatar->getID());
@ -6214,8 +6214,8 @@ class LLAvatarAddContact : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar)
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f
if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
create_inventory_callingcard(avatar->getID());
@ -6281,8 +6281,8 @@ bool enable_pay_avatar()
LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
LLVOAvatar* avatar = find_avatar_from_object(obj);
// return (avatar != NULL);
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
return (avatar != NULL) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [RLVa:KB] - Checked: RLVa-1.2.1
return (avatar != NULL) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID()));
// [/RLVa:KB]
}
@ -6597,8 +6597,8 @@ class LLShowAgentProfile : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(agent_id);
// if (avatar)
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d
if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gAgent.getID() == agent_id)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar) && ((RlvActions::canShowName(RlvActions::SNC_DEFAULT, agent_id)) || (gAgent.getID() == agent_id)) )
// [/RLVa:KB]
{
LLAvatarActions::showProfile(avatar->getID());
@ -7309,8 +7309,8 @@ class LLAvatarSendIM : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar)
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::startIM(avatar->getID());
@ -7325,8 +7325,8 @@ class LLAvatarCall : public view_listener_t
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
// if(avatar)
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d
if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [RLVa:KB] - Checked: RLVa-1.2.0
if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) )
// [/RLVa:KB]
{
LLAvatarActions::startCall(avatar->getID());
@ -7335,10 +7335,16 @@ class LLAvatarCall : public view_listener_t
}
};
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b
// [RLVa:KB] - Checked: RLVa-1.2.1
bool enable_avatar_call()
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (LLAvatarActions::canCall());
if (RlvActions::isRlvEnabled())
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
if ((!pAvatar) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID())))
return false;
}
return LLAvatarActions::canCall();
}
// [/RLVa:KB]
@ -9550,10 +9556,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Added: RLVa-1.2.0
// [RLVa:KB] - Checked: RLVa-2.0.0
enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1));
if (rlv_handler_t::isEnabled())
if (RlvActions::isRlvEnabled())
{
enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName));
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
}
// [/RLVa:KB]

View File

@ -1549,13 +1549,12 @@ void LLOfferInfo::send_auto_receive_response(void)
{
// add buddy to recent people list
// LLRecentPeople::instance().add(mFromID);
// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f
// RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler()
if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(mFromID)) ||
(RlvUIEnabler::hasOpenIM(mFromID)) || ((RlvUIEnabler::hasOpenProfile(mFromID))) )
{
// [RLVa:KB] - Checked: RLVa-2.0.1
// RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler()
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID));
if (fRlvCanShowName)
LLRecentPeople::instance().add(mFromID);
}
// [/RLVa:KB]
}
}
@ -1837,9 +1836,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
// [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
std::string name_slurl = LLSLURL("agent", mFromID, "about").getSLURLString();
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler()
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) )
// [RLVa:KB] - Checked: RLVa-2.0.1
// RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler()
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID));
if (!fRlvCanShowName)
name_slurl = LLSLURL("agent", mFromID, "rlvanonym").getSLURLString();
// [/RLVa:KB]
@ -2108,9 +2109,9 @@ void inventory_offer_handler(LLOfferInfo* info)
// Object -> Agent Inventory Offer
if (info->mFromObject && !bAutoAccept)
{
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only filter if the object owner is a nearby agent
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
{
payload["rlv_shownames"] = TRUE;
args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "rlvanonym").getSLURLString();
@ -2131,10 +2132,11 @@ void inventory_offer_handler(LLOfferInfo* info)
}
else // Agent -> Agent Inventory Offer
{
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-2.0.1
// Only filter if the offer is from a nearby agent and if there's no open IM session (doesn't necessarily have to be focused)
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) &&
(!RlvUIEnabler::hasOpenIM(info->mFromID)) )
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) || (!RlvUtil::isNearbyAgent(info->mFromID)) || (RlvUIEnabler::hasOpenIM(info->mFromID)) || (RlvUIEnabler::hasOpenProfile(info->mFromID));
if (!fRlvCanShowName)
{
payload["rlv_shownames"] = TRUE;
args["NAME"] = RlvStrings::getAnonym(info->mFromName);
@ -2989,11 +2991,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_INVENTORY_ACCEPTED:
{
// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();;
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize 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)) && (RlvUtil::isNearbyAgent(from_id)) &&
(!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();;
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
@ -3006,11 +3008,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_INVENTORY_DECLINED:
{
// args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();;
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
// Only anonymize 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)) && (RlvUtil::isNearbyAgent(from_id)) &&
(!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();;
bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) ||
(RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id));
args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
LLSD payload;
payload["from_id"] = from_id;
@ -3073,18 +3075,18 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
LLSD query_string;
query_string["owner"] = from_id;
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
if (rlv_handler_t::isEnabled())
// [RLVa:KB] - Checked: RLVa-1.2.0
if (RlvActions::isRlvEnabled())
{
// NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat()
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) )
if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) )
{
query_string["rlv_shownames"] = TRUE;
RlvUtil::filterNames(name);
chat.mFromName = name;
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
{
std::string::size_type idxPos = location.find('/');
if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) )
@ -3939,7 +3941,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
// Filtering "rules":
// avatar => filter only their name (unless it's this avie)
// other => filter everything
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
{
if (CHAT_SOURCE_AGENT != chat.mSourceType)
{
@ -3949,19 +3951,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
{
chat.mFromName = RlvStrings::getAnonym(chat.mFromName);
chat.mRlvNamesFiltered = TRUE;
}
}
}
// Create an "objectim" URL for objects if we're either @shownames or @showloc restricted
// (we need to do this now because we won't be have enough information to do it later on)
if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) &&
((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) )
if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) &&
( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) || (!RlvActions::canShowLocation()) ) )
{
LLSD sdQuery;
sdQuery["name"] = chat.mFromName;
sdQuery["owner"] = owner_id;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) )
if ( (!RlvActions::canShowName(RlvActions::SNC_COUNT, owner_id)) && (!is_owned_by_me) )
sdQuery["rlv_shownames"] = true;
const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent);
@ -6585,12 +6587,12 @@ void process_alert_core(const std::string& message, BOOL modal)
}
std::string new_msg =LLNotifications::instance().getGlobalString(text);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == text) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == text) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -6601,12 +6603,12 @@ void process_alert_core(const std::string& message, BOOL modal)
{
LLSD args;
std::string new_msg =LLNotifications::instance().getGlobalString(message);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == message) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == message) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -6625,12 +6627,12 @@ void process_alert_core(const std::string& message, BOOL modal)
std::string localized_msg;
bool is_message_localized = LLTrans::findString(localized_msg, new_msg);
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
if ( (new_msg == message) && (rlv_handler_t::isEnabled()) )
// [RLVa:KB] - Checked: RLVa-1.4.5
if ( (new_msg == message) && (RlvActions::isRlvEnabled()) )
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
if (!RlvActions::canShowLocation())
RlvUtil::filterLocation(new_msg);
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT))
RlvUtil::filterNames(new_msg);
}
// [/RLVa:KB]
@ -7569,14 +7571,14 @@ void send_lures(const LLSD& notification, const LLSD& response)
// Record the offer.
{
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
bool fRlvHideName = notification["payload"]["rlv_shownames"].asBoolean();
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvCanShowName = (!notification["payload"].has("rlv_shownames")) ? true : !notification["payload"]["rlv_shownames"].asBoolean();
// [/RLVa:KB]
std::string target_name;
gCacheName->getFullName(target_id, target_name); // for im log filenames
LLSD args;
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
args["TO_NAME"] = LLSLURL("agent", target_id, (!fRlvHideName) ? "displayname" : "rlvanonym").getSLURLString();;
// [RLVa:KB] - Checked: RLVa-2.0.1
args["TO_NAME"] = LLSLURL("agent", target_id, (fRlvCanShowName) ? "displayname" : "rlvanonym").getSLURLString();;
// [/RLVa:KB]
// args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
@ -7588,8 +7590,8 @@ void send_lures(const LLSD& notification, const LLSD& response)
LLNotificationsUtil::add("TeleportOfferSent", args, payload);
// Add the recepient to the recent people list.
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
if (!fRlvHideName)
// [RLVa:KB] - Checked: RLVa-2.0.1
if (fRlvCanShowName)
LLRecentPeople::instance().add(target_id);
// [/RLVa:KB]
// LLRecentPeople::instance().add(target_id);
@ -7643,25 +7645,32 @@ void handle_lure(const uuid_vec_t& ids)
// edit_args["REGION"] = gAgent.getRegion()->getName();
LLSD payload;
for (std::vector<LLUUID>::const_iterator it = ids.begin();
it != ids.end();
++it)
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShouldHideNames = false;
for (const LLUUID& idAgent : ids)
{
// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a
// Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it);
if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it, RLV_CHECK_PERMISSIVE)) &&
const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(idAgent);
if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, idAgent, RLV_CHECK_PERMISSIVE)) &&
((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) )
{
RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT_OFFER);
return;
}
}
payload["rlv_shownames"] = !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER);
// [/RLVa:KB]
payload["ids"].append(*it);
fRlvShouldHideNames |= !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER, idAgent);
payload["ids"].append(idAgent);
}
payload["rlv_shownames"] = fRlvShouldHideNames;
// [/RLVa:KB]
// for (std::vector<LLUUID>::const_iterator it = ids.begin();
// it != ids.end();
// ++it)
// {
// payload["ids"].append(*it);
// }
if (gAgent.isGodlike())
{
LLNotificationsUtil::add("OfferTeleportFromGod", edit_args, payload, handle_lure_callback);

View File

@ -96,7 +96,8 @@
#include "llanimstatelabels.h"
#include "lltrans.h"
#include "llappearancemgr.h"
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c)
// [RLVa:KB] - Checked: RLVa-2.0.1
#include "rlvactions.h"
#include "rlvhandler.h"
// [/RLVa:KB]
@ -2624,15 +2625,20 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
const F32 time_visible = mTimeVisible.getElapsedTimeF32();
const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds
const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b
bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShowAvTag = true, fRlvShowAvName = true;
if (RlvActions::isRlvEnabled())
{
fRlvShowAvTag = RlvActions::canShowName(RlvActions::SNC_NAMETAG, getID());
fRlvShowAvName = (fRlvShowAvTag) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID()));
}
// [/RLVa:KB]
BOOL visible_avatar = isVisible() || mNeedsAnimUpdate;
BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping);
BOOL render_name = visible_chat ||
(visible_avatar &&
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-1.0.0h
( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) &&
// [RLVa:KB] - Checked: RLVa-2.0.1
(fRlvShowAvTag) &&
// [/RLVa:KB]
((sRenderName == RENDER_NAME_ALWAYS) ||
(sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME)));
@ -2665,8 +2671,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
new_name = TRUE;
}
// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b
if (fRlvShowNames)
// [RLVa:KB] - Checked: RLVa-0.2.0
if (!fRlvShowAvName)
{
if (mRenderGroupTitles)
{
@ -2743,8 +2749,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
// Avatars must have a first and last name
if (!firstname || !lastname) return;
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// [RLVa:KB] - Checked: RLVa-2.0.1
bool fRlvShowAvName = RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID());
// [/RLVa:KB]
bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end();
bool is_do_not_disturb = mSignaledAnimations.find(ANIM_AGENT_DO_NOT_DISTURB) != mSignaledAnimations.end();
@ -2759,8 +2765,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
is_muted = LLMuteList::getInstance()->isMuted(getID());
}
// bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a
bool is_friend = (!fRlvShowNames) && (LLAvatarTracker::instance().isBuddy(getID()));
// [RLVa:KB] - Checked: RLVa-1.2.2
bool is_friend = (fRlvShowAvName) && (LLAvatarTracker::instance().isBuddy(getID()));
// [/RLVa:KB]
bool is_cloud = getIsCloud();
@ -2827,8 +2833,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
}
// if (sRenderGroupTitles
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if (sRenderGroupTitles && !fRlvShowNames
// [RLVa:KB] - Checked: RLVa-1.2.2
if (sRenderGroupTitles && fRlvShowAvName
// [/RLVa:KB]
&& title && title->getString() && title->getString()[0] != '\0')
{
@ -2851,8 +2857,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
clearNameTag();
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (!fRlvShowNames) || (isSelf()) )
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (fRlvShowAvName) || (isSelf()) )
{
// [/RLVa:KB]
// Might be blank if name not available yet, that's OK
@ -2869,7 +2875,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
addNameTagLine(av_name.getUserName(), username_color, LLFontGL::NORMAL,
LLFontGL::getFontSansSerifSmall());
}
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// [RLVa:KB] - Checked: RLVa-1.2.2
}
else
{
@ -2881,8 +2887,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
{
const LLFontGL* font = LLFontGL::getFontSansSerif();
std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() );
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
if ( (fRlvShowNames) && (!isSelf()) )
// [RLVa:KB] - Checked: RLVa-1.2.2
if ( (!fRlvShowAvName) && (!isSelf()) )
{
full_name = RlvStrings::getAnonym(full_name);
}

View File

@ -77,6 +77,29 @@ bool RlvActions::canStartIM(const LLUUID& idRecipient)
( (hasOpenP2PSession(idRecipient)) || (hasOpenGroupSession(idRecipient)) );
}
bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent)
{
// Handle most common case upfront
if (!s_BlockNamesContexts[eContext])
return true;
if (idAgent.notNull())
{
switch (eContext)
{
// Show/hide avatar nametag
case SNC_NAMETAG:
return (gRlvHandler.isException(RLV_BHVR_SHOWNAMETAGS, idAgent)) || (gAgentID == idAgent);
// Show/hide avatar name
case SNC_DEFAULT:
case SNC_TELEPORTOFFER:
case SNC_TELEPORTREQUEST:
return gRlvHandler.isException(RLV_BHVR_SHOWNAMES, idAgent);
}
}
return false;
}
// ============================================================================
// Movement
//

View File

@ -59,9 +59,9 @@ public:
* (This is used to hide an avatar name in one case but not a near-identical case - such as teleporting a friend vs a nearby agent -
* in a way that limits the amount of code that needs to be changed to carry context from one function to another)
*/
enum EShowNamesContext { SNC_TELEPORTOFFER = 0, SNC_TELEPORTREQUEST, SNC_COUNT };
static bool canShowName(EShowNamesContext eContext) { return (eContext < SNC_COUNT) ? !s_BlockNamesContexts[eContext] : false; }
static void setShowName(EShowNamesContext eContext, bool fShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fShowName; } }
enum EShowNamesContext { SNC_DEFAULT = 0, SNC_NAMETAG, SNC_TELEPORTOFFER, SNC_TELEPORTREQUEST, SNC_COUNT };
static bool canShowName(EShowNamesContext eContext, const LLUUID& idAgent = LLUUID::null);
static void setShowName(EShowNamesContext eContext, bool fCanShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fCanShowName; } }
protected:
// Backwards logic so that we can initialize to 0 and it won't block when we forget to/don't check if RLVa is disabled

View File

@ -37,6 +37,13 @@
#include "lscript_byteformat.h"
#include <boost/algorithm/string.hpp>
// ============================================================================
// Forward declarations
//
// llviewermenu.cpp
LLVOAvatar* find_avatar_from_object(LLViewerObject* object);
// ============================================================================
// RlvNotifications
//
@ -377,7 +384,7 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy)
for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++)
{
LLAvatarName avName;
if (LLAvatarNameCache::get(idAgents[idxAgent], &avName))
if ( (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgents[idxAgent])) )
{
const std::string& strDisplayName = avName.getDisplayName();
bool fFilterDisplay = (strDisplayName.length() > 2);
@ -583,6 +590,12 @@ void rlvMenuToggleVisible()
}
}
bool rlvMenuCanShowName()
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
return (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID()));
}
// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g
bool rlvMenuEnableIfNot(const LLSD& sdParam)
{

View File

@ -198,6 +198,7 @@ typedef bool (RlvExtCommandHandler::*rlvExtCommandHandler)(const RlvCommand& rlv
bool rlvMenuMainToggleVisible(LLUICtrl* pMenuItem);
void rlvMenuToggleVisible();
bool rlvMenuCanShowName();
bool rlvMenuEnableIfNot(const LLSD& sdParam);
// ============================================================================

View File

@ -122,10 +122,13 @@ enum ERlvBehaviour {
RLV_BHVR_SHOWWORLDMAP, // "showworldmap"
RLV_BHVR_SHOWLOC, // "showloc"
RLV_BHVR_SHOWNAMES, // "shownames"
RLV_BHVR_SHOWNAMETAGS, // "shownametags"
RLV_BHVR_SHOWHOVERTEXT, // "showhovertext"
RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud"
RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld"
RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall"
RLV_BHVR_SHOWSELF,
RLV_BHVR_SHOWSELFHEAD,
RLV_BHVR_TPLM, // "tplm"
RLV_BHVR_TPLOC, // "tploc"
RLV_BHVR_TPLOCAL,
@ -324,6 +327,7 @@ enum ERlvAttachGroupType
#define RLV_STRING_BLOCKED_STARTCONF "blocked_startconf"
#define RLV_STRING_BLOCKED_STARTIM "blocked_startim"
#define RLV_STRING_BLOCKED_TELEPORT "blocked_teleport"
#define RLV_STRING_BLOCKED_TELEPORT_OFFER "blocked_teleport_offer"
#define RLV_STRING_BLOCKED_TPLUREREQ_REMOTE "blocked_tplurerequest_remote"
#define RLV_STRING_BLOCKED_VIEWXXX "blocked_viewxxx"
#define RLV_STRING_BLOCKED_WIREFRAME "blocked_wireframe"

View File

@ -111,6 +111,8 @@ bool rlvGetShowException(ERlvBehaviour eBhvr)
case RLV_BHVR_TPREQUEST:
case RLV_BHVR_ACCEPTTP:
case RLV_BHVR_ACCEPTTPREQUEST:
case RLV_BHVR_SHOWNAMES:
case RLV_BHVR_SHOWNAMETAGS:
return true;
default:
return false;

View File

@ -29,9 +29,13 @@
#include "llviewerregion.h"
// Command specific includes
#include "llavatarnamecache.h" // @shownames
#include "llavatarlist.h" // @shownames
#include "llenvmanager.h" // @setenv
#include "llfloatersidepanelcontainer.h"// @shownames
#include "lloutfitslist.h" // @showinv - "Appearance / My Outfits" panel
#include "llpaneloutfitsinventory.h" // @showinv - "Appearance" floater
#include "llpanelpeople.h" // @shownames
#include "llpanelwearing.h" // @showinv - "Appearance / Current Outfit" panel
#include "llsidepanelappearance.h" // @showinv - "Appearance / Edit appearance" panel
#include "lltabcontainer.h" // @showinv - Tab container control for inventory tabs
@ -1704,6 +1708,92 @@ void RlvBehaviourToggleHandler<RLV_BHVR_SHOWINV>::onCommandToggle(ERlvBehaviour
RlvUIEnabler::instance().removeGenericFloaterFilter("inventory");
}
// Handles: @shownames[:<uuid>]=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SHOWNAMES>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (LLApp::isQuitting())
return; // Nothing to do if the viewer is shutting down
// Update the shownames context
RlvActions::setShowName(RlvActions::SNC_DEFAULT, !fHasBhvr);
// Refresh the nearby people list
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// Force the use of the "display name" cache so we can filter both display and legacy names (or return back to the user's preference)
if (fHasBhvr)
{
LLAvatarNameCache::setForceDisplayNames(true);
}
else
{
LLAvatarNameCache::setForceDisplayNames(false);
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
}
// Refresh all name tags and HUD text
LLVOAvatar::invalidateNameTags();
LLHUDText::refreshAllObjectText();
}
// Handles: @shownames[:<uuid>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SHOWNAMES>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
ERlvCmdRet eRet = RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_EXCEPTION>::onCommand(rlvCmd, fRefCount);
if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) && (!LLApp::isQuitting()) )
{
const LLUUID idAgent = RlvCommandOptionHelper::parseOption<LLUUID>(rlvCmd.getOption());
// Refresh the nearby people list (if necessary)
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) && (pPeoplePanel->getNearbyList()->contains(idAgent)) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// Refresh that avatar's name tag and all HUD text
LLVOAvatar::invalidateNameTag(idAgent);
LLHUDText::refreshAllObjectText();
}
return eRet;
}
// Handles: @shownametags[:<uuid>]=n|y toggles
template<> template<>
void RlvBehaviourToggleHandler<RLV_BHVR_SHOWNAMETAGS>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
{
if (LLApp::isQuitting())
return; // Nothing to do if the viewer is shutting down
// Update the shownames context
RlvActions::setShowName(RlvActions::SNC_NAMETAG, !fHasBhvr);
// Refresh all name tags
LLVOAvatar::invalidateNameTags();
}
// Handles: @shownametags[:<uuid>]=n|y
template<> template<>
ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SHOWNAMETAGS>::onCommand(const RlvCommand& rlvCmd, bool& fRefCount)
{
ERlvCmdRet eRet = RlvBehaviourGenericHandler<RLV_OPTION_NONE_OR_EXCEPTION>::onCommand(rlvCmd, fRefCount);
if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) )
LLVOAvatar::invalidateNameTag(RlvCommandOptionHelper::parseOption<LLUUID>(rlvCmd.getOption()));
return eRet;
}
// ============================================================================
// Command handlers (RLV_TYPE_FORCE)
//

View File

@ -137,7 +137,8 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_SHOWINV, RLV_OPTION_NONE>("showinv"));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showloc", RLV_BHVR_SHOWLOC));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showminimap", RLV_BHVR_SHOWMINIMAP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("shownames", RLV_BHVR_SHOWNAMES));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SHOWNAMES>("shownames", RlvBehaviourInfo::BHVR_STRICT));
addEntry(new RlvBehaviourToggleProcessor<RLV_BHVR_SHOWNAMETAGS>("shownametags", RlvBehaviourInfo::BHVR_STRICT ));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showworldmap", RLV_BHVR_SHOWWORLDMAP));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sit", RLV_BHVR_SIT));
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("sittp", RLV_BHVR_SITTP));

View File

@ -17,14 +17,11 @@
#include "llviewerprecompiledheaders.h"
#include "llagent.h"
#include "llavataractions.h" // LLAvatarActions::profileVisible()
#include "llavatarlist.h" // Avatar list control used by the "Nearby" tab in the "People" sidebar panel
#include "llavatarnamecache.h"
#include "llfloatersidepanelcontainer.h"
#include "llhudtext.h" // LLHUDText::refreshAllObjectText()
#include "llimview.h" // LLIMMgr::computeSessionID()
#include "llmoveview.h" // Movement panel (contains "Stand" and "Stop Flying" buttons)
#include "llnavigationbar.h" // Navigation bar
#include "llpanelpeople.h" // "People" sidebar panel
#include "llparcel.h"
#include "llpaneltopinfobar.h"
#include "llteleporthistory.h"
@ -47,7 +44,6 @@ RlvUIEnabler::RlvUIEnabler()
// onRefreshHoverText()
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWNAMES, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTALL, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTWORLD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWHOVERTEXTHUD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this)));
@ -65,7 +61,6 @@ RlvUIEnabler::RlvUIEnabler()
// onToggleXXX
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWMINIMAP, boost::bind(&RlvUIEnabler::onToggleShowMinimap, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWNAMES, boost::bind(&RlvUIEnabler::onToggleShowNames, this, _1)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWWORLDMAP, boost::bind(&RlvUIEnabler::onToggleShowWorldMap, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onToggleUnsit, this)));
@ -211,42 +206,6 @@ void RlvUIEnabler::onToggleShowMinimap()
}
}
// Checked: 2010-12-08 (RLVa-1.4.0a) | Modified: RLVa-1.2.2c
void RlvUIEnabler::onToggleShowNames(bool fQuitting)
{
if (fQuitting)
return; // Nothing to do if the viewer is shutting down
bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
// Refresh the nearby people list
LLPanelPeople* pPeoplePanel = LLFloaterSidePanelContainer::getPanel<LLPanelPeople>("people", "panel_people");
RLV_ASSERT( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) );
if ( (pPeoplePanel) && (pPeoplePanel->getNearbyList()) )
{
if (pPeoplePanel->getNearbyList()->isInVisibleChain())
pPeoplePanel->onCommit();
pPeoplePanel->getNearbyList()->updateAvatarNames();
}
// // Refresh the speaker list
// LLCallFloater* pCallFloater = LLFloaterReg::findTypedInstance<LLCallFloater>("voice_controls");
// if (pCallFloater)
// pCallFloater->getAvatarCallerList()->updateAvatarNames();
// Force the use of the "display name" cache so we can filter both display and legacy names (or return back to the user's preference)
if (!fEnable)
{
LLAvatarNameCache::setForceDisplayNames(true);
}
else
{
LLAvatarNameCache::setForceDisplayNames(false);
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
}
LLVOAvatar::invalidateNameTags(); // See handleDisplayNamesOptionChanged()
}
// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a
void RlvUIEnabler::onToggleShowWorldMap()
{

View File

@ -47,7 +47,6 @@ protected:
void onToggleMovement(); // fly, alwaysrun and temprun
void onToggleShowLoc(); // showloc
void onToggleShowMinimap(); // showminimap
void onToggleShowNames(bool fQuitting); // shownames
void onToggleShowWorldMap(); // showworldmap
void onToggleTp(); // tploc and tplm
void onToggleUnsit(); // unsit

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
enabled="false"
@ -28,8 +27,7 @@
<menu_item_call.on_click
function="Avatar.SendIM" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Call"
@ -45,8 +43,7 @@
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_separator />
<menu_item_call

View File

@ -10,8 +10,7 @@
function="ShowAgentProfile"
parameter="hit object" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
enabled="false"
@ -28,8 +27,7 @@
<menu_item_call.on_click
function="Avatar.SendIM" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_call
label="Call"
@ -45,8 +43,7 @@
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="shownames" />
function="RLV.CanShowName" />
</menu_item_call>
<menu_item_separator />
@ -110,6 +107,8 @@
name="Pay...">
<menu_item_call.on_click
function="PayObject" />
<menu_item_call.on_enable
function="EnablePayAvatar" />
</menu_item_call>
<menu_item_separator />

View File

@ -1643,16 +1643,6 @@
function="ToggleControl"
parameter="RestrainedLoveShowEllipsis" />
</menu_item_check>
<menu_item_check
label="Show Name Tags"
name="Show Name Tags">
<menu_item_check.on_check
function="CheckControl"
parameter="RLVaShowNameTags" />
<menu_item_check.on_click
function="ToggleControl"
parameter="RLVaShowNameTags" />
</menu_item_check>
<menu_item_check
label="Wear Replaces Unlocked"
name="Wear Replaces Unlocked">

View File

@ -81,6 +81,11 @@
<key>value</key>
<string>Unable to initiate teleport due to RLV restrictions</string>
</map>
<key>blocked_teleport_offer</key>
<map>
<key>value</key>
<string>Unable to offer teleport due to RLV restrictions</string>
</map>
<key>blocked_viewxxx</key>
<map>
<key>value</key>