summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorHadetTheUndying <hadet@protonmail.com>2026-06-04 14:58:38 -0500
committerErik Kundiman <erik@megapahit.org>2026-06-05 10:03:41 +0800
commitb5c4fec2c0065311508aa1a268a8a4e510674dc5 (patch)
treeefc0a0a692b48830124b205ee9b467521bbcdb8b /indra/newview/llavataractions.cpp
parent4a48c18093f164ac741664554323dccccc213719 (diff)
Add Estate Eject and Estate Ban to avatar context menusHEADmain
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp85
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);