summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2009-12-23 10:00:41 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2009-12-23 10:00:41 +0200
commit633c15570a52082030667ec2d096058f16ccf228 (patch)
tree674de11ffa2ee17e36e226e698a327ec55aa1481 /indra/newview/llavataractions.cpp
parent4d9762eb846ae1894f0c31eecb6230803018e730 (diff)
parent0a98034641267ea57360fdd369acb8b94ff9bc20 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp110
1 files changed, 109 insertions, 1 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index c5a1ffdcb3..2a8c55e5db 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -243,7 +243,6 @@ void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids)
return;
}
- // start the call once the session has fully initialized
gIMMgr->autoStartCallOnStartup(session_id);
make_ui_sound("UISndStartIM");
@@ -333,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)
{
@@ -457,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);