summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2009-12-22 17:49:35 +0200
committerIgor Borovkov <iborovkov@productengine.com>2009-12-22 17:49:35 +0200
commit191e5f9ca033cd1520950f35309c0bc2c4499803 (patch)
tree684ccc50f33104413f9c52fe2ee4c3302ec77bb6 /indra/newview/llavataractions.cpp
parent304e321f89e9a517ba90d6b41999a65591639ad9 (diff)
parentd4a8f4c6efd11b4cb3ccba320f18e8508668b915 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp109
1 files changed, 109 insertions, 0 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 9f7a36e209..2a8c55e5db 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -332,6 +332,54 @@ void LLAvatarActions::pay(const LLUUID& id)
}
}
+// static
+void LLAvatarActions::kick(const LLUUID& id)
+{
+ LLSD payload;
+ payload["avatar_id"] = id;
+ LLNotifications::instance().add("KickUser", LLSD(), payload, handleKick);
+}
+
+// static
+void LLAvatarActions::freeze(const LLUUID& id)
+{
+ LLSD payload;
+ payload["avatar_id"] = id;
+ LLNotifications::instance().add("FreezeUser", LLSD(), payload, handleFreeze);
+}
+
+// static
+void LLAvatarActions::unfreeze(const LLUUID& id)
+{
+ LLSD payload;
+ payload["avatar_id"] = id;
+ LLNotifications::instance().add("UnFreezeUser", LLSD(), payload, handleUnfreeze);
+}
+
+//static
+void LLAvatarActions::csr(const LLUUID& id, std::string name)
+{
+ if (name.empty()) return;
+
+ std::string url = "http://csr.lindenlab.com/agent/";
+
+ // slow and stupid, but it's late
+ S32 len = name.length();
+ for (S32 i = 0; i < len; i++)
+ {
+ if (name[i] == ' ')
+ {
+ url += "%20";
+ }
+ else
+ {
+ url += name[i];
+ }
+ }
+
+ LLWeb::loadURL(url);
+}
+
//static
void LLAvatarActions::share(const LLUUID& id)
{
@@ -456,6 +504,67 @@ bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, con
}
// static
+bool LLAvatarActions::handleKick(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotification::getSelectedOption(notification, response);
+
+ if (option == 0)
+ {
+ LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
+ LLMessageSystem* msg = gMessageSystem;
+
+ msg->newMessageFast(_PREHASH_GodKickUser);
+ msg->nextBlockFast(_PREHASH_UserInfo);
+ msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
+ msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
+ msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
+ msg->addU32("KickFlags", KICK_FLAGS_DEFAULT );
+ msg->addStringFast(_PREHASH_Reason, response["message"].asString() );
+ gAgent.sendReliableMessage();
+ }
+ return false;
+}
+bool LLAvatarActions::handleFreeze(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotification::getSelectedOption(notification, response);
+
+ if (option == 0)
+ {
+ LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
+ LLMessageSystem* msg = gMessageSystem;
+
+ msg->newMessageFast(_PREHASH_GodKickUser);
+ msg->nextBlockFast(_PREHASH_UserInfo);
+ msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
+ msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
+ msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
+ msg->addU32("KickFlags", KICK_FLAGS_FREEZE );
+ msg->addStringFast(_PREHASH_Reason, response["message"].asString() );
+ gAgent.sendReliableMessage();
+ }
+ return false;
+}
+bool LLAvatarActions::handleUnfreeze(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotification::getSelectedOption(notification, response);
+ std::string text = response["message"].asString();
+ if (option == 0)
+ {
+ LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
+ LLMessageSystem* msg = gMessageSystem;
+
+ msg->newMessageFast(_PREHASH_GodKickUser);
+ msg->nextBlockFast(_PREHASH_UserInfo);
+ msg->addUUIDFast(_PREHASH_GodID, gAgent.getID() );
+ msg->addUUIDFast(_PREHASH_GodSessionID, gAgent.getSessionID());
+ msg->addUUIDFast(_PREHASH_AgentID, avatar_id );
+ msg->addU32("KickFlags", KICK_FLAGS_UNFREEZE );
+ msg->addStringFast(_PREHASH_Reason, text );
+ gAgent.sendReliableMessage();
+ }
+ return false;
+}
+// static
bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);