diff options
author | Jonathan Yap <none@none> | 2012-06-04 11:23:38 -0400 |
---|---|---|
committer | Jonathan Yap <none@none> | 2012-06-04 11:23:38 -0400 |
commit | 47044de069c2c1442a33d719846cdbf1e3450124 (patch) | |
tree | 1b1c514ce203c01835b8a60688008cf02282cc23 /indra/newview/llviewermessage.cpp | |
parent | a519e34f02b4b2663fe082ba9ad12f1b423669cb (diff) |
STORM-1838 Add "Request Teleport" option to the menu when right-clicking on avatars in the Nearby list
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 854e2bea52..f4f7148340 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1992,6 +1992,54 @@ bool lure_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback); +bool teleport_requested_callback(const LLSD& notification, const LLSD& response) +{ + LLUUID from_id = notification["payload"]["from_id"].asUUID(); + std::string from_name; + gCacheName->getFullName(from_id, from_name); + + if(from_id.isNull() || (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; + + // Block + case 2: + { + LLMute mute(from_id, from_name, LLMute::AGENT); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + break; + } + return false; +} + +static LLNotificationFunctorRegistration teleport_requested_callback_reg("TeleportRequested", teleport_requested_callback); + bool goto_url_callback(const LLSD& notification, const LLSD& response) { std::string url = notification["payload"]["url"].asString(); |