diff options
author | Jonathan Yap <none@none> | 2013-01-25 06:23:56 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-01-25 06:23:56 -0500 |
commit | 0afbc85efadfb3e3e825a5cade9f76876fbdf1a4 (patch) | |
tree | 892d784d3490ee82262a6bcdaeb264005f824654 /indra/newview/llavataractions.cpp | |
parent | 12182d7cc3fbc3462e7dbacd09c975dc76b8f75f (diff) |
STORM-1838 Minor UI improvements and code changes
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rwxr-xr-x | indra/newview/llavataractions.cpp | 73 |
1 files changed, 46 insertions, 27 deletions
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); |