summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-01-18 16:37:07 -0500
committerOz Linden <oz@lindenlab.com>2013-01-18 16:37:07 -0500
commit3e3fda589b11d53fceb9bbeed9f0333d88c3816f (patch)
tree43bfd5e88ede272242db36d9000fcdac84541725 /indra
parentd16757545c91d4f7dac3c52a311ad0f0239052e1 (diff)
parent70722454f6650438c9b659ff08b4d7bc6dfc2e7e (diff)
merge up to 3.4.4-release
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/llinstantmessage.h2
-rwxr-xr-xindra/newview/llavataractions.cpp38
-rw-r--r--indra/newview/llavataractions.h5
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp1
-rwxr-xr-xindra/newview/llviewermessage.cpp83
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml6
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby.xml7
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml23
8 files changed, 161 insertions, 4 deletions
diff --git a/indra/llmessage/llinstantmessage.h b/indra/llmessage/llinstantmessage.h
index e0dae376b4..febc59c4bc 100644
--- a/indra/llmessage/llinstantmessage.h
+++ b/indra/llmessage/llinstantmessage.h
@@ -126,7 +126,7 @@ enum EInstantMessage
IM_LURE_ACCEPTED = 23,
IM_LURE_DECLINED = 24,
IM_GODLIKE_LURE_USER = 25,
- IM_YET_TO_BE_USED = 26,
+ IM_TELEPORT_REQUEST = 26,
// IM that notifie of a new group election.
// Name is name of person who called vote.
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index fdd4565e50..51313f29c4 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -71,6 +71,8 @@
#include "llcallingcard.h"
#include "llslurl.h" // IDEVO
#include "llsidepanelinventory.h"
+#include "llavatarname.h"
+#include "llagentui.h"
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -396,6 +398,42 @@ void LLAvatarActions::pay(const LLUUID& id)
}
// static
+void LLAvatarActions::teleportRequest(const LLUUID& id)
+{
+ LLMessageSystem* msg = gMessageSystem;
+
+ msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+
+ msg->nextBlockFast(_PREHASH_MessageBlock);
+ msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
+ msg->addUUIDFast(_PREHASH_ToAgentID, id);
+ msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
+ msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
+ msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
+ msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
+
+ std::string name;
+ LLAgentUI::buildFullname(name);
+
+ msg->addStringFast(_PREHASH_FromAgentName, name);
+ msg->addStringFast(_PREHASH_Message, LLStringUtil::null);
+ msg->addU32Fast(_PREHASH_ParentEstateID, 0);
+ msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
+ msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
+
+ gMessageSystem->addBinaryDataFast(
+ _PREHASH_BinaryBucket,
+ EMPTY_BINARY_BUCKET,
+ EMPTY_BINARY_BUCKET_SIZE);
+
+ gAgent.sendReliableMessage();
+llwarns << "DBG REQUEST_TELEPORT sent" << llendl;
+}
+
+// static
void LLAvatarActions::kick(const LLUUID& id)
{
LLSD payload;
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 748b7cb3d1..f3df953e98 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -109,6 +109,11 @@ public:
static void pay(const LLUUID& id);
/**
+ * Request teleport from other avatar
+ */
+ static void teleportRequest(const LLUUID& id);
+
+ /**
* Share items with the avatar.
*/
static void share(const LLUUID& id);
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index f12c4de2f7..499dfd36fc 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -67,6 +67,7 @@ LLContextMenu* NearbyMenu::createMenu()
registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id));
registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id));
registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id));
+ registrar.add("Avatar.TeleportRequest", boost::bind(&LLAvatarActions::teleportRequest, id));
enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2));
enable_registrar.add("Avatar.CheckItem", boost::bind(&NearbyMenu::checkContextMenuItem, this, _2));
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index b048332e59..a2a9b13eb5 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2035,6 +2035,70 @@ bool mature_lure_callback(const LLSD& notification, const LLSD& response)
}
static LLNotificationFunctorRegistration mature_lure_callback_reg("TeleportOffered_MaturityExceeded", mature_lure_callback);
+bool teleport_request_callback(const LLSD& notification, const LLSD& response)
+{
+ LLUUID from_id = notification["payload"]["from_id"].asUUID();
+ if(from_id.isNull())
+ {
+ llwarns << "from_id is NULL" << llendl;
+ return false;
+ }
+
+ std::string from_name;
+ gCacheName->getFullName(from_id, from_name);
+llwarns << "DBG " << from_name << " " << from_id << llendl;
+
+ if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))
+ {
+ return false;
+ }
+
+ S32 option = 0;
+ if (response.isInteger())
+ {
+ option = response.asInteger();
+ }
+ else
+ {
+ option = LLNotificationsUtil::getSelectedOption(notification, response);
+ }
+
+ switch(option)
+ {
+ // Yes
+ case 0:
+ {
+ LLAvatarActions::offerTeleport(from_id);
+ }
+ break;
+
+ // No
+ case 1:
+ default:
+ break;
+
+ // IM
+ case 2:
+ {
+llwarns << "DBG start IM" << llendl;
+ LLAvatarActions::startIM(from_id);
+ }
+ break;
+
+/* // Block
+ case 3:
+ {
+ LLMute mute(from_id, from_name, LLMute::AGENT);
+ LLMuteList::getInstance()->add(mute);
+ LLPanelBlockedList::showPanelAndSelect(mute.mID);
+ }
+ break; */
+ }
+ return false;
+}
+
+static LLNotificationFunctorRegistration teleport_request_callback_reg("TeleportRequest", teleport_request_callback);
+
bool goto_url_callback(const LLSD& notification, const LLSD& response)
{
std::string url = notification["payload"]["url"].asString();
@@ -2158,7 +2222,7 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t
case IM_LURE_ACCEPTED:
case IM_LURE_DECLINED:
case IM_GODLIKE_LURE_USER:
- case IM_YET_TO_BE_USED:
+ case IM_TELEPORT_REQUEST:
case IM_GROUP_ELECTION_DEPRECATED:
//IM_GOTO_URL
//IM_FROM_TASK_AS_ALERT
@@ -2913,7 +2977,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
break;
case IM_LURE_USER:
+ case IM_TELEPORT_REQUEST:
{
+llwarns << "DBG teleport processing" << llendl;
if (is_muted)
{
return;
@@ -3007,12 +3073,23 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
else
{
- LLNotification::Params params("TeleportOffered");
+ LLNotification::Params params;
+ if (IM_LURE_USER == dialog)
+ {
+ params.name = "TeleportOffered";
+ params.functor.name = "TeleportOffered";
+ }
+ else if (IM_TELEPORT_REQUEST == dialog)
+ {
+ llwarns << "DBG TELEPORT_REQUEST received" << llendl;
+ params.name = "TeleportRequest";
+ params.functor.name = "TeleportRequest";
+ }
+
params.substitutions = args;
params.payload = payload;
LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false);
}
-
}
}
break;
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 13dc0b941a..ef315e1a8d 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -598,6 +598,12 @@
function="Inventory.BeginIMSession"
parameter="selected" />
</menu_item_call>
+ <menu_item_call
+ label="Request Teleport"
+ name="Request Teleport">
+ <menu_item_call.on_click
+ function="Avatar.TeleportRequest" />
+ </menu_item_call>
<menu_item_separator
layout="topleft"
name="Gesture Separator" />
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index d2e35e4cc0..951f43f325 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -70,6 +70,13 @@
<menu_item_call.on_click
function="Avatar.Pay" />
</menu_item_call>
+ <menu_item_call
+ label="Request Teleport"
+ layout="topleft"
+ name="Request Teleport">
+ <menu_item_call.on_click
+ function="Avatar.TeleportRequest" />
+ </menu_item_call>
<menu_item_check
label="Block/Unblock"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9dae77a304..0628e54902 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6515,6 +6515,29 @@ However, this region contains content accessible to adults only.
Teleport offer sent to [TO_NAME]
</notification>
+ <notification
+ icon="notify.tga"
+ name="TeleportRequest"
+ type="notify">
+[NAME_SLURL] is requesting to be teleported your to your location.
+
+Will you permit this?
+ <tag>confirm</tag>
+ <form name="form">
+ <button
+ index="0"
+ name="Yes"
+ text="Yes"/>
+ <button
+ index="1"
+ name="No"
+ text="No"/>
+ <button
+ index="2"
+ name="IM"
+ text="IM"/>
+ </form>
+ </notification>
<notification
icon="notify.tga"