diff options
Diffstat (limited to 'indra/newview/llavataractions.cpp')
| -rw-r--r-- | indra/newview/llavataractions.cpp | 105 |
1 files changed, 103 insertions, 2 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 6f6b89ea81..85d69f0a30 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -29,13 +29,12 @@ #include "llavataractions.h" -#include "boost/lambda/lambda.hpp" // for lambda::constant - #include "llavatarnamecache.h" // IDEVO #include "llsd.h" #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 @@ -339,6 +338,17 @@ void LLAvatarActions::showProfile(const LLUUID& avatar_id) } } +bool LLAvatarActions::myProfileVisible() +{ + LLFloater* floaterp = getProfileFloater(gAgentID); + return floaterp && floaterp->isInVisibleChain(); +} + +bool LLAvatarActions::myPicksTabVisible() +{ + return myProfileVisible() && isPickTabSelected(gAgentID); +} + // static void LLAvatarActions::showPicks(const LLUUID& avatar_id) { @@ -627,6 +637,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; @@ -855,6 +893,13 @@ namespace action_give_inventory break; } LLViewerInventoryItem* inv_item = gInventory.getItem(*it); + if (!inv_item) + { + shared = false; + LL_WARNS() << "Failed to share an item " << *it + << ". Item was not found in inventory." << LL_ENDL; + continue; + } if (!inv_item->getPermissions().allowCopyBy(gAgentID)) { if (!noncopy_item_names.empty()) @@ -1427,6 +1472,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); |
