diff options
author | Oz Linden <oz@lindenlab.com> | 2013-04-01 14:24:01 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-04-01 14:24:01 -0400 |
commit | 2fde4a9ae55a8641a5a7a9091af4d598b7e8d847 (patch) | |
tree | 1ffa1f6a643579fd32da5fc241f03a5fdd2cbf42 /indra/llui/llurlaction.cpp | |
parent | e42142005585f580d39036fba02ec060d739cc5f (diff) | |
parent | 7333731bbca764fdac87173fa5a6e5f2bb46c1d2 (diff) |
merge changes for 3.5.0-beta7
Diffstat (limited to 'indra/llui/llurlaction.cpp')
-rw-r--r-- | indra/llui/llurlaction.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index fd9b3d9a6d..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; @@ -157,3 +157,34 @@ void LLUrlAction::showProfile(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) + { + 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"); + } +} + |