diff options
| author | HadetTheUndying <hadet@protonmail.com> | 2026-06-04 14:58:38 -0500 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-06-05 10:03:41 +0800 |
| commit | b5c4fec2c0065311508aa1a268a8a4e510674dc5 (patch) | |
| tree | efc0a0a692b48830124b205ee9b467521bbcdb8b /indra/newview/llavataractions.cpp | |
| parent | 4a48c18093f164ac741664554323dccccc213719 (diff) | |
Diffstat (limited to 'indra/newview/llavataractions.cpp')
| -rw-r--r-- | indra/newview/llavataractions.cpp | 85 |
1 files changed, 85 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); |
