diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llavataractions.cpp | 85 | ||||
| -rw-r--r-- | indra/newview/llavataractions.h | 6 | ||||
| -rw-r--r-- | indra/newview/llpanelpeoplemenus.cpp | 16 | ||||
| -rw-r--r-- | indra/newview/llpanelpeoplemenus.h | 1 | ||||
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 41 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_avatar_other.xml | 16 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_people_nearby.xml | 16 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 12 |
8 files changed, 193 insertions, 0 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index fb1426a235..c6b17fcb4e 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -34,6 +34,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "roles_constants.h" // for GP_MEMBER_INVITE +#include "llregionflags.h" // for ESTATE_ACCESS_BANNED_AGENT_ADD #include "llagent.h" #include "llappviewer.h" // for gLastVersionChannel @@ -625,6 +626,34 @@ void LLAvatarActions::ejectAvatar(const LLUUID& id, bool ban_enabled) } // static +void LLAvatarActions::estateKickAvatar(const LLUUID& id) +{ + LLAvatarName av_name; + LLSD payload; + payload["avatar_id"] = id; + LLSD args; + if (LLAvatarNameCache::get(id, &av_name)) + { + args["EVIL_USER"] = av_name.getCompleteName(); + } + LLNotificationsUtil::add("EstateKickUser", args, payload, handleEstateKickAvatar); +} + +// static +void LLAvatarActions::estateBanAvatar(const LLUUID& id) +{ + LLAvatarName av_name; + LLSD payload; + payload["avatar_id"] = id; + LLSD args; + if (LLAvatarNameCache::get(id, &av_name)) + { + args["AVATAR_NAME"] = av_name.getCompleteName(); + } + LLNotificationsUtil::add("EstateBanUser", args, payload, handleEstateBanAvatar); +} + +// static void LLAvatarActions::freeze(const LLUUID& id) { LLSD payload; @@ -1425,6 +1454,62 @@ bool LLAvatarActions::handleEjectAvatar(const LLSD& notification, const LLSD& re return false; } +bool LLAvatarActions::handleEstateKickAvatar(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("EstateOwnerMessage"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); + msg->nextBlock("MethodData"); + msg->addString("Method", "kickestate"); + msg->addUUID("Invoice", LLUUID::generateNewID()); + msg->nextBlock("ParamList"); + msg->addString("Parameter", avatar_id.asString()); + gAgent.sendReliableMessage(); + } + return false; +} + +bool LLAvatarActions::handleEstateBanAvatar(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID(); + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("EstateOwnerMessage"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); + msg->nextBlock("MethodData"); + msg->addString("Method", "estateaccessdelta"); + msg->addUUID("Invoice", LLUUID::generateNewID()); + + std::string buf; + gAgent.getID().toString(buf); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + buf = llformat("%u", (U32)ESTATE_ACCESS_BANNED_AGENT_ADD); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + avatar_id.toString(buf); + msg->nextBlock("ParamList"); + msg->addString("Parameter", buf); + + gAgent.sendReliableMessage(); + } + return false; +} + bool LLAvatarActions::handleFreeze(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 1f5a42ed22..bc4eb6fa60 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -192,6 +192,10 @@ public: static void freezeAvatar(const LLUUID& id); static void ejectAvatar(const LLUUID& id, bool ban_enabled = false); + + static void estateKickAvatar(const LLUUID& id); + + static void estateBanAvatar(const LLUUID& id); /** * Kick avatar off grid */ @@ -263,6 +267,8 @@ private: static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id); static bool handleFreezeAvatar(const LLSD& notification, const LLSD& response); static bool handleEjectAvatar(const LLSD& notification, const LLSD& response); + static bool handleEstateKickAvatar(const LLSD& notification, const LLSD& response); + static bool handleEstateBanAvatar(const LLSD& notification, const LLSD& response); static bool handleKick(const LLSD& notification, const LLSD& response); static bool handleFreeze(const LLSD& notification, const LLSD& response); static bool handleUnfreeze(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 794ae4ad44..537ea28a4d 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -84,11 +84,14 @@ LLContextMenu* PeopleContextMenu::createMenu() registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id)); registrar.add("Avatar.Freeze", boost::bind(&LLAvatarActions::freezeAvatar, id)); registrar.add("Avatar.Eject", boost::bind(&PeopleContextMenu::eject, this)); + registrar.add("Avatar.EstateKick", boost::bind(&LLAvatarActions::estateKickAvatar, id)); + registrar.add("Avatar.EstateBan", boost::bind(&LLAvatarActions::estateBanAvatar, id)); enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2)); enable_registrar.add("Avatar.CheckItem", boost::bind(&PeopleContextMenu::checkContextMenuItem, this, _2)); enable_registrar.add("Avatar.EnableFreezeEject", boost::bind(&PeopleContextMenu::enableFreezeEject, this, _2)); + enable_registrar.add("Avatar.EnableEstateEjectBan", boost::bind(&PeopleContextMenu::enableEstateEjectBan, this, _2)); // create the context menu from the XUI menu = createFromFile("menu_people_nearby.xml"); @@ -318,6 +321,17 @@ bool PeopleContextMenu::enableFreezeEject(const LLSD& userdata) return new_value; } +bool PeopleContextMenu::enableEstateEjectBan(const LLSD& userdata) +{ + if (gAgent.getID() == mUUIDs.front() || mUUIDs.size() != 1) + return false; + + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return false; + if (gAgent.isGodlike()) return true; + return region->getOwner() == gAgent.getID() || region->isEstateManager(); +} + void PeopleContextMenu::requestTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), @@ -419,6 +433,8 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) items.push_back(std::string("block_unblock")); items.push_back(std::string("freeze")); items.push_back(std::string("eject")); + items.push_back(std::string("estate_eject")); + items.push_back(std::string("estate_ban")); } hide_context_entries(menu, items, disabled_items); diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index ad38cebc31..ad6a26c645 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -47,6 +47,7 @@ private: bool enableContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); bool enableFreezeEject(const LLSD& userdata); + bool enableEstateEjectBan(const LLSD& userdata); void offerTeleport(); void eject(); void startConference(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 833a3cde6f..1b1d703f38 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4065,6 +4065,44 @@ void handle_avatar_eject(const LLSD& avatar_id) } } +void handle_avatar_estate_kick(const LLSD& avatar_id) +{ + LLUUID id = avatar_id.asUUID(); + if (id.isNull()) + { + LLVOAvatar* avatar = find_avatar_from_object( + LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if (avatar) id = avatar->getID(); + } + if (id.notNull()) + { + LLAvatarActions::estateKickAvatar(id); + } +} + +void handle_avatar_estate_ban(const LLSD& avatar_id) +{ + LLUUID id = avatar_id.asUUID(); + if (id.isNull()) + { + LLVOAvatar* avatar = find_avatar_from_object( + LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if (avatar) id = avatar->getID(); + } + if (id.notNull()) + { + LLAvatarActions::estateBanAvatar(id); + } +} + +bool enable_estate_eject_ban(const LLSD& avatar_id) +{ + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return false; + if (gAgent.isGodlike()) return true; + return region->getOwner() == gAgent.getID() || region->isEstateManager(); +} + bool my_profile_visible() { LLFloater* floaterp = LLAvatarActions::getProfileFloater(gAgentID); @@ -10358,6 +10396,9 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug"); view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); + commit.add("Avatar.EstateKick", boost::bind(&handle_avatar_estate_kick, _2)); + commit.add("Avatar.EstateBan", boost::bind(&handle_avatar_estate_ban, _2)); + enable.add("Avatar.EnableEstateEjectBan", boost::bind(&enable_estate_eject_ban, _2)); commit.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector)); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index fc4ffde947..f86e9160ed 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -90,6 +90,22 @@ function="Avatar.EnableFreezeEject"/> </menu_item_call> <menu_item_call + label="Estate Eject" + name="EstateEject..."> + <menu_item_call.on_click + function="Avatar.EstateKick" /> + <menu_item_call.on_visible + function="Avatar.EnableEstateEjectBan"/> + </menu_item_call> + <menu_item_call + label="Estate Ban" + name="EstateBan..."> + <menu_item_call.on_click + function="Avatar.EstateBan" /> + <menu_item_call.on_visible + function="Avatar.EnableEstateEjectBan"/> + </menu_item_call> + <menu_item_call label="Debug Textures" name="Debug..."> <menu_item_call.on_click 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 b7a296bf31..8d73eee60a 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -169,4 +169,20 @@ <menu_item_call.on_visible function="Avatar.EnableFreezeEject"/> </menu_item_call> + <menu_item_call + label="Estate Eject" + name="estate_eject"> + <menu_item_call.on_click + function="Avatar.EstateKick" /> + <menu_item_call.on_visible + function="Avatar.EnableEstateEjectBan"/> + </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.EnableEstateEjectBan"/> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index facf9b7e46..65f26d50e7 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5404,6 +5404,18 @@ Kick [EVIL_USER] from this estate? <notification icon="alertmodal.tga" + name="EstateBanUser" + type="alertmodal"> +Ban [AVATAR_NAME] from this estate? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Ban"/> + </notification> + + <notification + icon="alertmodal.tga" name="EstateChangeCovenant" type="alertmodal"> Are you sure you want to change the Estate Covenant? |
