Added estate ban option to people panel

meow-7.2.2
Ansariel 2012-12-20 17:17:40 +01:00
parent 11707155be
commit c86e520969
9 changed files with 211 additions and 14 deletions

View File

@ -86,7 +86,8 @@
#include "fslslbridge.h"
//<FS:KC legacy profiles>
#include "fsfloaterprofile.h"
#include "llfloaterregioninfo.h"
#include "lltrans.h"
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@ -1667,3 +1668,116 @@ bool LLAvatarActions::callbackEstateTeleportHome(const LLSD& notification, const
return false;
}
// [/SL:KB]
// <FS:Ansariel> Estate ban user
void LLAvatarActions::estateBan(const LLUUID& idAgent)
{
uuid_vec_t idAgents;
idAgents.push_back(idAgent);
estateBanMultiple(idAgents);
}
void LLAvatarActions::estateBanMultiple(const uuid_vec_t& idAgents)
{
LLViewerRegion* region = gAgent.getRegion();
if (!region)
{
return;
}
uuid_vec_t idEjectAgents(idAgents);
if (!canEstateKickOrTeleportHomeMultiple(idEjectAgents, true))
return;
LLSD args, payload; std::string strMsgName, strResidents;
for (uuid_vec_t::const_iterator itAgent = idEjectAgents.begin(); itAgent != idEjectAgents.end(); ++itAgent)
{
const LLUUID& idAgent = *itAgent;
if (idEjectAgents.begin() != itAgent)
strResidents += "\n";
strResidents += LLSLURL("agent", idAgent, (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? "completename" : "rlvanonym").getSLURLString();
payload["ids"].append(*itAgent);
}
std::string owner = LLSLURL("agent", region->getOwner(), "inspect").getSLURLString();
if (gAgent.isGodlike())
{
LLStringUtil::format_map_t owner_args;
owner_args["[OWNER]"] = owner;
args["ALL_ESTATES"] = LLTrans::getString("RegionInfoAllEstatesOwnedBy", owner_args);
}
else if (region->getOwner() == gAgent.getID())
{
args["ALL_ESTATES"] = LLTrans::getString("RegionInfoAllEstatesYouOwn");
}
else if (region->isEstateManager())
{
LLStringUtil::format_map_t owner_args;
owner_args["[OWNER]"] = owner.c_str();
args["ALL_ESTATES"] = LLTrans::getString("RegionInfoAllEstatesYouManage", owner_args);
}
if (1 == payload["ids"].size())
{
args["EVIL_USER"] = strResidents;
strMsgName = "EstateBanUser";
}
else
{
args["RESIDENTS"] = strResidents;
strMsgName = "EstateBanUserMultiple";
}
LLNotificationsUtil::add(strMsgName, args, payload, &callbackEstateBan);
}
bool LLAvatarActions::callbackEstateBan(const LLSD& notification, const LLSD& response)
{
LLViewerRegion* region = gAgent.getRegion();
S32 idxOption = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == idxOption || 1 == idxOption)
{
const LLSD& idAgents = notification["payload"]["ids"];
for (LLSD::array_const_iterator itAgent = idAgents.beginArray(); itAgent != idAgents.endArray(); ++itAgent)
{
if (region->getOwner() == itAgent->asUUID())
{
// Can't ban the owner!
continue;
}
U32 flags = ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE;
if (itAgent + 1 != idAgents.endArray())
{
flags |= ESTATE_ACCESS_NO_REPLY;
}
if (idxOption == 1)
{
// All estates, either than I own or manage for this owner.
// This will be verified on simulator. JC
if (!region)
{
break;
}
if (region->getOwner() == gAgent.getID()
|| gAgent.isGodlike())
{
flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES;
}
else if (region->isEstateManager())
{
flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES;
}
}
LLFloaterRegionInfo::nextInvoice();
LLPanelEstateInfo::sendEstateAccessDelta(flags, itAgent->asUUID());
}
}
return false;
}
// </FS:Ansariel> Estate ban user

View File

@ -239,11 +239,18 @@ public:
static void estateKickMultiple(const uuid_vec_t& idAgents);
static void estateTeleportHomeMultiple(const uuid_vec_t& idAgents);
// <FS:Ansariel> Estate ban
static void estateBan(const LLUUID& idAgent);
static void estateBanMultiple(const uuid_vec_t& idAgents);
// </FS:Ansariel> Estate ban
static std::set<LLUUID> getInventorySelectedUUIDs();
protected:
static bool callbackEstateKick(const LLSD& notification, const LLSD& response);
static bool callbackEstateTeleportHome(const LLSD& notification, const LLSD& response);
// <FS:Ansariel> Estate ban
static bool callbackEstateBan(const LLSD& notification, const LLSD& response);
private:
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);

View File

@ -82,6 +82,8 @@ LLContextMenu* NearbyMenu::createMenu()
registrar.add("Avatar.TeleportHome", boost::bind(&LLAvatarActions::estateTeleportHome, id));
enable_registrar.add("Avatar.VisibleKickTeleportHome", boost::bind(&LLAvatarActions::canEstateKickOrTeleportHome, id));
// [/SL:KB]
// <FS:Ansariel> Estate ban user
registrar.add("Avatar.EstateBan", boost::bind(&LLAvatarActions::estateBan, id));
registrar.add("Nearby.People.TeleportToAvatar", boost::bind(&NearbyMenu::teleportToAvatar, this));
registrar.add("Nearby.People.TrackAvatar", boost::bind(&NearbyMenu::onTrackAvatarMenuItemClick, this));
@ -114,6 +116,8 @@ LLContextMenu* NearbyMenu::createMenu()
registrar.add("Avatar.TeleportHome", boost::bind(&LLAvatarActions::estateTeleportHomeMultiple, mUUIDs));
enable_registrar.add("Avatar.VisibleKickTeleportHome", boost::bind(&LLAvatarActions::canEstateKickOrTeleportHomeMultiple, mUUIDs, false));
// [/SL:KB]
// <FS:Ansariel> Estate ban user
registrar.add("Avatar.EstateBan", boost::bind(&LLAvatarActions::estateBanMultiple, mUUIDs));
// create the context menu from the XUI
return createFromFile("menu_people_nearby_multiselect.xml");

View File

@ -20,4 +20,5 @@
<menu_item_call label="Parzelle: Entfernen" name="eject"/>
<menu_item_call label="Estate: Hinauswerfen" name="kick"/>
<menu_item_call label="Estate: Teleport nach Hause" name="teleport_home"/>
<menu_item_call label="Estate: Verbannen" name="estate_ban"/>
</context_menu>

View File

@ -11,4 +11,5 @@
<menu_item_call label="Parzelle: Entfernen" name="eject"/>
<menu_item_call label="Estate: Hinauswerfen" name="kick"/>
<menu_item_call label="Estate: Teleport nach Hause" name="teleport_home"/>
<menu_item_call label="Estate: Verbannen" name="estate_ban"/>
</context_menu>

View File

@ -1782,9 +1782,36 @@ Tausende Regionen werden verändert und der Spaceserver wird dadurch stark belas
<usetemplate canceltext="Abbrechen" name="yesnocancelbuttons" notext="Alle Grundbesitze" yestext="Diesen Grundbesitz"/>
</notification>
<notification label="Rauswurf bestätigen" name="EstateKickUser">
Benutzer [EVIL_USER] von diesem Grundbesitz werfen?
Einwohner [EVIL_USER] von diesem Grundbesitz werfen?
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification label="Rauswurf bestätigen" name="EstateKickMultiple">
Die folgenden Einwohner von diesem Grundbesitz werfen?
[RESIDENTS]
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification label="Nach Hause teleportieren bestätigen" name="EstateTeleportHomeUser">
[AVATAR_NAME] nach Hause teleportieren?
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification label="Nach Hause teleportieren bestätigen" name="EstateTeleportHomeMultiple">
Die folgenden Einwohnern nach Hause teleportieren?
[RESIDENTS]
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification label="Verbannen bestätigen" name="EstateBanUser">
Zugang für [EVIL_USER] nur für diesen Grundbesitz oder für [ALL_ESTATES] verweigern?
<usetemplate name="yesnocancelbuttons" canceltext="Abbrechen" notext="Alle Grundbesitze" yestext="Diesen Grundbesitz"/>
</notification>
<notification label="Verbannen bestätigen" name="EstateBanUserMultiple">
Zugang für folgende Einwohner nur für diesen Grundbesitz oder für [ALL_ESTATES] verweigern?
[RESIDENTS]
<usetemplate name="yesnocancelbuttons" canceltext="Abbrechen" notext="Alle Grundbesitze" yestext="Diesen Grundbesitz"/>
</notification>
<notification name="EstateChangeCovenant">
Möchten Sie den Grundbesitzvertrag wirklich ändern?
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>

View File

@ -164,6 +164,14 @@
<menu_item_call.on_visible
function="Avatar.VisibleKickTeleportHome"/>
</menu_item_call>
<menu_item_call
label="Estate Ban"
name="estate_ban">
<menu_item_call.on_click
function="Avatar.EstateBan"/>
<menu_item_call.on_visible
function="Avatar.VisibleKickTeleportHome"/>
</menu_item_call>

View File

@ -75,7 +75,7 @@
function="Avatar.VisibleFreezeEject"/>
</menu_item_call>
<menu_item_call
label="Eject"
label="Parcel Eject"
name="eject">
<menu_item_call.on_click
function="Avatar.Eject"/>
@ -83,7 +83,7 @@
function="Avatar.VisibleFreezeEject"/>
</menu_item_call>
<menu_item_call
label="Kick"
label="Estate Kick"
name="kick">
<menu_item_call.on_click
function="Avatar.Kick"/>
@ -91,12 +91,20 @@
function="Avatar.VisibleKickTeleportHome"/>
</menu_item_call>
<menu_item_call
label="Teleport Home"
label="Estate Teleport Home"
name="teleport_home">
<menu_item_call.on_click
function="Avatar.TeleportHome"/>
<menu_item_call.on_visible
function="Avatar.VisibleKickTeleportHome"/>
</menu_item_call>
<menu_item_call
label="Estate Ban"
name="estate_ban">
<menu_item_call.on_click
function="Avatar.EstateBan"/>
<menu_item_call.on_visible
function="Avatar.VisibleKickTeleportHome"/>
</menu_item_call>
</context_menu>

View File

@ -4388,18 +4388,33 @@ Teleport the following residents home?
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="EstateChangeCovenant"
type="alertmodal">
Are you sure you want to change the estate covenant?
icon="alert.tga"
label="Confirm Ban"
name="EstateBanUser"
type="alert">
Deny access for [EVIL_USER] for this estate only or for [ALL_ESTATES]?
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
name="yesnocancelbuttons"
canceltext="Cancel"
notext="All Estatees"
yestext="This Estate"/>
</notification>
<notification
icon="alert.tga"
label="Confirm Ban"
name="EstateBanUserMultiple"
type="alert">
Deny access for the following residents this estate only or for [ALL_ESTATES]?
[RESIDENTS]
<usetemplate
name="yesnocancelbuttons"
canceltext="Cancel"
notext="All Estatees"
yestext="This Estate"/>
</notification>
<notification
@ -4413,6 +4428,18 @@ Are you sure you want to change the estate covenant?
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="EstateChangeCovenant"
type="alertmodal">
Are you sure you want to change the estate covenant?
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="RegionEntryAccessBlocked_AdultsOnlyContent"