summaryrefslogtreecommitdiff
path: root/indra/llui/llurlaction.cpp
diff options
context:
space:
mode:
authormberezhnoy <mberezhnoy@productengine.com>2013-03-14 19:12:38 +0200
committermberezhnoy <mberezhnoy@productengine.com>2013-03-14 19:12:38 +0200
commit5b4746701bcacd0562fc7876f4b6db652ccfcb3b (patch)
tree85ee66681c62b2efe2b59287590a57a8fa94dd9b /indra/llui/llurlaction.cpp
parent3ee18d8b29caa612ee7656aa1ac69e3c1edce4cc (diff)
parentb6d973d31380e7d35f7ed014d682dfc5f2465afe (diff)
merging
Diffstat (limited to 'indra/llui/llurlaction.cpp')
-rw-r--r--indra/llui/llurlaction.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp
index fd872eca4b..f51aeaec13 100644
--- a/indra/llui/llurlaction.cpp
+++ b/indra/llui/llurlaction.cpp
@@ -24,7 +24,6 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
#include "linden_common.h"
#include "llurlaction.h"
@@ -32,6 +31,7 @@
#include "llwindow.h"
#include "llurlregistry.h"
+
// global state for the callback functions
LLUrlAction::url_callback_t LLUrlAction::sOpenURLCallback;
LLUrlAction::url_callback_t LLUrlAction::sOpenURLInternalCallback;
@@ -158,16 +158,33 @@ void LLUrlAction::showProfile(std::string url)
}
}
-void LLUrlAction::sendIM(std::string url)
+std::string LLUrlAction::getUserID(std::string url)
{
LLURI uri(url);
LLSD path_array = uri.pathArray();
+ std::string id_str;
if (path_array.size() == 4)
{
- std::string id_str = path_array.get(2).asString();
- if (LLUUID::validate(id_str))
- {
- executeSLURL("secondlife:///app/agent/" + id_str + "/im");
- }
+ id_str = path_array.get(2).asString();
}
+ return id_str;
}
+
+void LLUrlAction::sendIM(std::string url)
+{
+ std::string id_str = getUserID(url);
+ if (LLUUID::validate(id_str))
+ {
+ executeSLURL("secondlife:///app/agent/" + id_str + "/im");
+ }
+}
+
+void LLUrlAction::addFriend(std::string url)
+{
+ std::string id_str = getUserID(url);
+ if (LLUUID::validate(id_str))
+ {
+ executeSLURL("secondlife:///app/agent/" + id_str + "/requestfriend");
+ }
+}
+