- changed : show a limited context menu in the nearby people panel when @shownames restricted
-> "Offer/Request Teleport" (filtered)
-> "Zoom in"
-> Block/Unblock
--HG--
branch : RLVa
parent
0d724b0387
commit
f6cd805dfc
|
|
@ -488,14 +488,17 @@ void LLAvatarActions::teleportRequest(const LLUUID& id)
|
|||
{
|
||||
LLSD notification;
|
||||
notification["uuid"] = id;
|
||||
LLAvatarName av_name;
|
||||
if (!LLAvatarNameCache::get(id, &av_name))
|
||||
{
|
||||
// unlikely ... they just picked this name from somewhere...
|
||||
LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id));
|
||||
return; // reinvoke this when the name resolves
|
||||
}
|
||||
notification["NAME"] = av_name.getCompleteName();
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST)) ? "completename" : "rlvanonym").getSLURLString();
|
||||
// [/RLVa:KB]
|
||||
// LLAvatarName av_name;
|
||||
// if (!LLAvatarNameCache::get(id, &av_name))
|
||||
// {
|
||||
// // unlikely ... they just picked this name from somewhere...
|
||||
// LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id));
|
||||
// return; // reinvoke this when the name resolves
|
||||
// }
|
||||
// notification["NAME"] = av_name.getCompleteName();
|
||||
|
||||
LLSD payload;
|
||||
|
||||
|
|
|
|||
|
|
@ -463,10 +463,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
|
|||
BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask);
|
||||
// if ( mContextMenu && !isAvalineItemSelected())
|
||||
// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d
|
||||
if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) )
|
||||
// [/RLVa:KB]
|
||||
if ( mContextMenu && !isAvalineItemSelected())
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
getSelectedUUIDs(selected_uuids);
|
||||
|
|
@ -588,11 +585,7 @@ void LLAvatarList::updateLastInteractionTimes()
|
|||
|
||||
void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask)
|
||||
{
|
||||
// mItemDoubleClickSignal(ctrl, x, y, mask);
|
||||
// [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d
|
||||
if ( (!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
|
||||
mItemDoubleClickSignal(ctrl, x, y, mask);
|
||||
// [/RLVa:KB]
|
||||
mItemDoubleClickSignal(ctrl, x, y, mask);
|
||||
}
|
||||
|
||||
bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const
|
||||
|
|
|
|||
|
|
@ -1146,6 +1146,13 @@ 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)
|
||||
{
|
||||
|
|
@ -1271,6 +1278,13 @@ 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);
|
||||
if ( selected_uuids.size() == 1 )
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
#include "llviewermenu.h" // for gMenuHolder
|
||||
#include "llconversationmodel.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
#include "rlvactions.h"
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
namespace LLPanelPeopleMenus
|
||||
{
|
||||
|
|
@ -187,7 +191,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
return result && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
|
||||
// [/RLVa:KB]
|
||||
// return result;
|
||||
}
|
||||
else if (item == std::string("can_delete"))
|
||||
{
|
||||
|
|
@ -210,7 +217,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
|
|||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
return result && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
|
||||
// [/RLVa:KB]
|
||||
// return result;
|
||||
}
|
||||
else if (item == std::string("can_call"))
|
||||
{
|
||||
|
|
@ -262,14 +272,26 @@ 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));
|
||||
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, fRlvCanShowName);
|
||||
LLAvatarActions::teleportRequest(mUUIDs.front());
|
||||
RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, true);
|
||||
// [/RLVa:KB]
|
||||
// LLAvatarActions::teleportRequest(mUUIDs.front());
|
||||
}
|
||||
|
||||
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));
|
||||
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, fRlvCanShowName);
|
||||
LLAvatarActions::offerTeleport(mUUIDs);
|
||||
RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, true);
|
||||
// [/RLVa:KB]
|
||||
// LLAvatarActions::offerTeleport(mUUIDs);
|
||||
}
|
||||
|
||||
//== NearbyPeopleContextMenu ===============================================================
|
||||
|
|
@ -279,7 +301,25 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
|
|||
menuentry_vec_t items;
|
||||
menuentry_vec_t disabled_items;
|
||||
|
||||
if (flags & ITEM_IN_MULTI_SELECTION)
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
if (flags & ITEM_IN_MULTI_SELECTION)
|
||||
{
|
||||
items.push_back(std::string("offer_teleport"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.push_back(std::string("offer_teleport"));
|
||||
items.push_back(std::string("request_teleport"));
|
||||
items.push_back(std::string("separator_invite_to_group"));
|
||||
items.push_back(std::string("zoom_in"));
|
||||
items.push_back(std::string("block_unblock"));
|
||||
}
|
||||
}
|
||||
else if (flags & ITEM_IN_MULTI_SELECTION)
|
||||
// [/RLVa:KB]
|
||||
// if (flags & ITEM_IN_MULTI_SELECTION)
|
||||
{
|
||||
items.push_back(std::string("add_friends"));
|
||||
items.push_back(std::string("remove_friends"));
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ namespace LLPanelPeopleMenus
|
|||
class PeopleContextMenu : public LLListContextMenu
|
||||
{
|
||||
public:
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
PeopleContextMenu() : m_fRlvCheck(false) {}
|
||||
// [/RLVa:KB]
|
||||
/*virtual*/ LLContextMenu* createMenu();
|
||||
|
||||
protected:
|
||||
|
|
@ -48,6 +51,11 @@ private:
|
|||
bool checkContextMenuItem(const LLSD& userdata);
|
||||
void offerTeleport();
|
||||
void requestTeleport();
|
||||
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
protected:
|
||||
bool m_fRlvCheck;
|
||||
// [/RLVa:KB]
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -55,6 +63,10 @@ private:
|
|||
*/
|
||||
class NearbyPeopleContextMenu : public PeopleContextMenu
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
public:
|
||||
NearbyPeopleContextMenu() : PeopleContextMenu() { m_fRlvCheck = true; }
|
||||
// [/RLVa:KB]
|
||||
protected:
|
||||
/*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7431,10 +7431,16 @@ 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]
|
||||
std::string target_name;
|
||||
gCacheName->getFullName(target_id, target_name); // for im log filenames
|
||||
LLSD args;
|
||||
args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
args["TO_NAME"] = LLSLURL("agent", target_id, (!fRlvHideName) ? "displayname" : "rlvanonym").getSLURLString();;
|
||||
// [/RLVa:KB]
|
||||
// args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();;
|
||||
|
||||
LLSD payload;
|
||||
|
||||
|
|
@ -7444,7 +7450,11 @@ void send_lures(const LLSD& notification, const LLSD& response)
|
|||
LLNotificationsUtil::add("TeleportOfferSent", args, payload);
|
||||
|
||||
// Add the recepient to the recent people list.
|
||||
LLRecentPeople::instance().add(target_id);
|
||||
// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6)
|
||||
if (!fRlvHideName)
|
||||
LLRecentPeople::instance().add(target_id);
|
||||
// [/RLVa:KB]
|
||||
// LLRecentPeople::instance().add(target_id);
|
||||
}
|
||||
}
|
||||
gAgent.sendReliableMessage();
|
||||
|
|
@ -7490,8 +7500,7 @@ void handle_lure(const uuid_vec_t& ids)
|
|||
|
||||
LLSD edit_args;
|
||||
// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a
|
||||
edit_args["REGION"] =
|
||||
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN);
|
||||
// [/RLVa:KB]
|
||||
// edit_args["REGION"] = gAgent.getRegion()->getName();
|
||||
|
||||
|
|
@ -7511,6 +7520,7 @@ void handle_lure(const uuid_vec_t& ids)
|
|||
return;
|
||||
}
|
||||
}
|
||||
payload["rlv_shownames"] = !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER);
|
||||
// [/RLVa:KB]
|
||||
payload["ids"].append(*it);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,10 @@
|
|||
#include "rlvhandler.h"
|
||||
|
||||
// ============================================================================
|
||||
// RlvActions member functions
|
||||
//
|
||||
// Communication/Avatar interaction
|
||||
//
|
||||
|
||||
bool RlvActions::s_BlockNamesContexts[SNC_COUNT] = { 0 };
|
||||
|
||||
// Checked: 2010-11-30 (RLVa-1.3.0)
|
||||
bool RlvActions::canReceiveIM(const LLUUID& idSender)
|
||||
|
|
@ -60,6 +62,10 @@ bool RlvActions::canStartIM(const LLUUID& idRecipient)
|
|||
( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) );
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Movement
|
||||
//
|
||||
|
||||
// Checked: 2010-12-11 (RLVa-1.2.2)
|
||||
bool RlvActions::canAcceptTpOffer(const LLUUID& idSender)
|
||||
{
|
||||
|
|
@ -84,6 +90,10 @@ bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester)
|
|||
return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// World interaction
|
||||
//
|
||||
|
||||
// Checked: 2010-03-07 (RLVa-1.2.0)
|
||||
bool RlvActions::canStand()
|
||||
{
|
||||
|
|
@ -97,6 +107,10 @@ bool RlvActions::canShowLocation()
|
|||
return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Helper functions
|
||||
//
|
||||
|
||||
// Checked: 2013-05-10 (RLVa-1.4.9)
|
||||
bool RlvActions::hasBehaviour(ERlvBehaviour eBhvr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
class RlvActions
|
||||
{
|
||||
// =============
|
||||
// Communication
|
||||
// =============
|
||||
// ================================
|
||||
// Communication/Avatar interaction
|
||||
// ================================
|
||||
public:
|
||||
/*
|
||||
* Returns true if the user is allowed to receive IMs from the specified sender (can be an avatar or a group)
|
||||
|
|
@ -44,6 +44,19 @@ public:
|
|||
*/
|
||||
static bool canStartIM(const LLUUID& idRecipient); // @startim and @startimto
|
||||
|
||||
/*
|
||||
* Returns true if an avatar's name should be hidden for the requested operation/context
|
||||
* (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; } }
|
||||
|
||||
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
|
||||
static bool s_BlockNamesContexts[SNC_COUNT];
|
||||
|
||||
// ========
|
||||
// Movement
|
||||
// ========
|
||||
|
|
|
|||
Loading…
Reference in New Issue