From 47044de069c2c1442a33d719846cdbf1e3450124 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 4 Jun 2012 11:23:38 -0400 Subject: STORM-1838 Add "Request Teleport" option to the menu when right-clicking on avatars in the Nearby list --- indra/newview/llavataractions.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f618af9536..8df30da68a 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -71,6 +71,7 @@ #include "llcallingcard.h" #include "llslurl.h" // IDEVO #include "llsidepanelinventory.h" +#include "llavatarname.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -395,6 +396,18 @@ void LLAvatarActions::pay(const LLUUID& id) } } +// static +void LLAvatarActions::requestTeleport(const LLUUID& id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_RequestTeleport); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, id); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); +} + // static void LLAvatarActions::kick(const LLUUID& id) { -- cgit v1.2.3 From e386aa73b7af5ca326f66fa3fb0482e42b3af33f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 11 Jan 2013 11:13:44 -0500 Subject: STORM-1838 --- indra/newview/llavataractions.cpp | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8df30da68a..0d00232c2f 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -72,6 +72,7 @@ #include "llslurl.h" // IDEVO #include "llsidepanelinventory.h" #include "llavatarname.h" +#include "llagentui.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -397,15 +398,44 @@ void LLAvatarActions::pay(const LLUUID& id) } // static -void LLAvatarActions::requestTeleport(const LLUUID& id) +void LLAvatarActions::teleportRequest(const LLUUID& id) { LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_RequestTeleport); + msg->newMessageFast(_PREHASH_ImprovedInstantMessage); msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, id); + 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); + +/* msg->newMessageFast(_PREHASH_TeleportRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, id); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); */ + gAgent.sendReliableMessage(); +llwarns << "DBG REQUEST_TELEPORT sent" << llendl; } // static -- cgit v1.2.3 From 70722454f6650438c9b659ff08b4d7bc6dfc2e7e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 18 Jan 2013 05:40:17 -0500 Subject: STORM-1838 Removed block of commented out code --- indra/newview/llavataractions.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 0d00232c2f..b2fb691a85 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -429,11 +429,6 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) EMPTY_BINARY_BUCKET, EMPTY_BINARY_BUCKET_SIZE); -/* msg->newMessageFast(_PREHASH_TeleportRequest); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, id); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); */ - gAgent.sendReliableMessage(); llwarns << "DBG REQUEST_TELEPORT sent" << llendl; } -- cgit v1.2.3 From f64e11dfe1490c1a89e00cf5dc368dd1dc25b866 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 24 Jan 2013 14:27:10 -0500 Subject: STORM-1838 Add optional message processing --- indra/newview/llavataractions.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 51313f29c4..d8449570a7 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -397,8 +397,7 @@ void LLAvatarActions::pay(const LLUUID& id) } } -// static -void LLAvatarActions::teleportRequest(const LLUUID& id) +void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response) { LLMessageSystem* msg = gMessageSystem; @@ -409,7 +408,7 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) msg->nextBlockFast(_PREHASH_MessageBlock); msg->addBOOLFast(_PREHASH_FromGroup, FALSE); - msg->addUUIDFast(_PREHASH_ToAgentID, id); + msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] ); msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST); msg->addUUIDFast(_PREHASH_ID, LLUUID::null); @@ -419,7 +418,7 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) LLAgentUI::buildFullname(name); msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, LLStringUtil::null); + msg->addStringFast(_PREHASH_Message, response["message"]); msg->addU32Fast(_PREHASH_ParentEstateID, 0); msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); @@ -433,6 +432,16 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) llwarns << "DBG REQUEST_TELEPORT sent" << llendl; } +// static +void LLAvatarActions::teleportRequest(const LLUUID& id) +{ + LLSD notification; + notification["uuid"] = id; + LLSD payload; + + LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback); +} + // static void LLAvatarActions::kick(const LLUUID& id) { -- cgit v1.2.3 From 12182d7cc3fbc3462e7dbacd09c975dc76b8f75f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 24 Jan 2013 15:29:36 -0500 Subject: STORM-1838 Break out a large block of code from handle_lure_callback so it can be called directly by teleport_request_callback. --- indra/newview/llavataractions.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index d8449570a7..b65810d357 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -429,7 +429,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const EMPTY_BINARY_BUCKET_SIZE); gAgent.sendReliableMessage(); -llwarns << "DBG REQUEST_TELEPORT sent" << llendl; } // static -- cgit v1.2.3 From 0afbc85efadfb3e3e825a5cade9f76876fbdf1a4 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 25 Jan 2013 06:23:56 -0500 Subject: STORM-1838 Minor UI improvements and code changes --- indra/newview/llavataractions.cpp | 73 ++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 27 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b65810d357..92e25e1a8b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -399,43 +399,62 @@ void LLAvatarActions::pay(const LLUUID& id) void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response) { - 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, notification["substitutions"]["uuid"] ); - 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); + S32 option; + if (response.isInteger()) + { + option = response.asInteger(); + } + else + { + option = LLNotificationsUtil::getSelectedOption(notification, response); + } - msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, response["message"]); - msg->addU32Fast(_PREHASH_ParentEstateID, 0); - msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); - msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); + if (0 == option) + { + LLMessageSystem* msg = gMessageSystem; - gMessageSystem->addBinaryDataFast( - _PREHASH_BinaryBucket, - EMPTY_BINARY_BUCKET, - EMPTY_BINARY_BUCKET_SIZE); + 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, notification["substitutions"]["uuid"] ); + 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, response["message"]); + 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(); + gAgent.sendReliableMessage(); + } } // static void LLAvatarActions::teleportRequest(const LLUUID& id) { + std::string name; + gCacheName->getFullName(id, name); + gCacheName->cleanFullName(name); + LLSD notification; notification["uuid"] = id; + notification["NAME"] = name + "'s"; + LLSD payload; LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback); -- cgit v1.2.3 From ec52db8d0c4099dd5e3b476f7b44a4ebda7cb676 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 5 Jun 2013 17:32:10 -0400 Subject: STORM-1838 Slowly reappling changes to work with CHUI --- indra/newview/llavataractions.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 45992b8c83..285e70c8ea 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,6 +443,7 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { +llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); -- cgit v1.2.3 From 9b1840c1c95a1a4adad913e0c162048fb78c537d Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 6 Jun 2013 16:34:24 -0400 Subject: STORM-1838 Added teleport request to conversation log. Added xml to have message appear in IM window, if open. Code cleanup. --- indra/newview/llavataractions.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 285e70c8ea..45992b8c83 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,7 +443,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { -llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); -- cgit v1.2.3 From 9e5dbcfde52f7cf32d2757172cf6de23bd3b8156 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 29 Jul 2013 13:52:48 -0400 Subject: STORM-1838 Add display name handling to the initial notification --- indra/newview/llavataractions.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 45992b8c83..5f1f57f550 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,13 +443,9 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { - std::string name; - gCacheName->getFullName(id, name); - gCacheName->cleanFullName(name); - LLSD notification; notification["uuid"] = id; - notification["NAME"] = name + "'s"; + notification["NAME_SLURL"] = LLSLURL("agent", id, "about").getSLURLString(); LLSD payload; -- cgit v1.2.3 From d43a302eaf1b0ca521d4b865e39a8d849da5d5b8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 16:51:59 -0400 Subject: MAINT-3075: don't display the target user name as a SLURL in the RequestTeleport dialog --- indra/newview/llavataractions.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 5f1f57f550..70cc48f12b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -445,7 +445,14 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) { LLSD notification; notification["uuid"] = id; - notification["NAME_SLURL"] = LLSLURL("agent", id, "about").getSLURLString(); + LLAvatarName av_name; + if (!LLAvatarNameCache::get(id, &av_name)) + { + // unlikely ... they just picked this name from somewhere... + LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id)); + return; // reinvoke this when the name resolves + } + notification["NAME"] = av_name.getCompleteName(); LLSD payload; -- cgit v1.2.3