summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2013-03-05 15:40:31 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2013-03-05 15:40:31 +0200
commit477920b13834c977659d11d91d8f2d52e05f54b8 (patch)
tree820b5723cb41b0103b00f61d5154ee62e90415a5 /indra
parent67741ae9786a88bb00f3419ad6a8ac8533481acb (diff)
CHUI-809 FIXED "Start IM" menu item is added
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp1
-rw-r--r--indra/llui/llurlaction.cpp14
-rw-r--r--indra/llui/llurlaction.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_agent.xml7
4 files changed, 23 insertions, 0 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7cee9f5b46..4bb819a7f6 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1911,6 +1911,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url));
registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url));
registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url));
+ registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url));
registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url));
registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url));
registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url));
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp
index fd9b3d9a6d..fd872eca4b 100644
--- a/indra/llui/llurlaction.cpp
+++ b/indra/llui/llurlaction.cpp
@@ -157,3 +157,17 @@ void LLUrlAction::showProfile(std::string url)
}
}
}
+
+void LLUrlAction::sendIM(std::string url)
+{
+ LLURI uri(url);
+ LLSD path_array = uri.pathArray();
+ 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");
+ }
+ }
+}
diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h
index c34960b826..f5f2ceba72 100644
--- a/indra/llui/llurlaction.h
+++ b/indra/llui/llurlaction.h
@@ -76,6 +76,7 @@ public:
/// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile
static void showProfile(std::string url);
+ static void sendIM(std::string url);
/// specify the callbacks to enable this class's functionality
typedef boost::function<void (const std::string&)> url_callback_t;
diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml
index 73f0fa7979..88ae441bd3 100644
--- a/indra/newview/skins/default/xui/en/menu_url_agent.xml
+++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml
@@ -3,6 +3,13 @@
layout="topleft"
name="Url Popup">
<menu_item_call
+ label="Send IM"
+ layout="topleft"
+ name="show_agent">
+ <menu_item_call.on_click
+ function="Url.SendIM" />
+ </menu_item_call>
+ <menu_item_call
label="Show Resident Profile"
layout="topleft"
name="show_agent">