diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a859eeb996..64878b8230 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -86,7 +86,8 @@ #include "fslslbridge.h" // #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] + +// 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; +} +// Estate ban user diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index e7ac7bc92b..4458a4e5d6 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -239,11 +239,18 @@ public: static void estateKickMultiple(const uuid_vec_t& idAgents); static void estateTeleportHomeMultiple(const uuid_vec_t& idAgents); + // Estate ban + static void estateBan(const LLUUID& idAgent); + static void estateBanMultiple(const uuid_vec_t& idAgents); + // Estate ban + static std::set getInventorySelectedUUIDs(); protected: static bool callbackEstateKick(const LLSD& notification, const LLSD& response); static bool callbackEstateTeleportHome(const LLSD& notification, const LLSD& response); + // Estate ban + static bool callbackEstateBan(const LLSD& notification, const LLSD& response); private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 282e07b96a..d16c7f555e 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -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] + // 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] + // 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"); diff --git a/indra/newview/skins/default/xui/de/menu_people_nearby.xml b/indra/newview/skins/default/xui/de/menu_people_nearby.xml index 4f5ea494dc..96fc7cf36d 100644 --- a/indra/newview/skins/default/xui/de/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/de/menu_people_nearby.xml @@ -20,4 +20,5 @@ + diff --git a/indra/newview/skins/default/xui/de/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/de/menu_people_nearby_multiselect.xml index bad3138249..2e10295515 100644 --- a/indra/newview/skins/default/xui/de/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/de/menu_people_nearby_multiselect.xml @@ -11,4 +11,5 @@ + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 231f9f8538..22696a9886 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -1782,9 +1782,36 @@ Tausende Regionen werden verändert und der Spaceserver wird dadurch stark belas - Benutzer [EVIL_USER] von diesem Grundbesitz werfen? + Einwohner [EVIL_USER] von diesem Grundbesitz werfen? + + Die folgenden Einwohner von diesem Grundbesitz werfen? + +[RESIDENTS] + + + + + [AVATAR_NAME] nach Hause teleportieren? + + + + Die folgenden Einwohnern nach Hause teleportieren? + +[RESIDENTS] + + + + Zugang für [EVIL_USER] nur für diesen Grundbesitz oder für [ALL_ESTATES] verweigern? + + + + Zugang für folgende Einwohner nur für diesen Grundbesitz oder für [ALL_ESTATES] verweigern? + +[RESIDENTS] + + Möchten Sie den Grundbesitzvertrag wirklich ändern? diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index ebe8b7b170..a6a75361ad 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -164,6 +164,14 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml index 8f5b41b4c6..5bf492b1c2 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml @@ -75,7 +75,7 @@ function="Avatar.VisibleFreezeEject"/> @@ -83,7 +83,7 @@ function="Avatar.VisibleFreezeEject"/> @@ -91,12 +91,20 @@ function="Avatar.VisibleKickTeleportHome"/> + + + + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a8e817e5b5..5099160b4d 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4388,18 +4388,33 @@ Teleport the following residents home? yestext="OK"/> - - -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]? confirm + name="yesnocancelbuttons" + canceltext="Cancel" + notext="All Estatees" + yestext="This Estate"/> + + + +Deny access for the following residents this estate only or for [ALL_ESTATES]? + +[RESIDENTS] + + +Are you sure you want to change the estate covenant? + confirm + + +