From 2b8beeeff1485682e2b47f330dc8b3c24e966961 Mon Sep 17 00:00:00 2001 From: mberezhnoy Date: Thu, 20 Jun 2013 12:45:22 +0300 Subject: CHUI-809 (Right-click menu on user name in compat chat mode doesn't have "IM") Fixed "Add friend" option always being greyed out, add ability to block object via context menu in compact chat mode. --- indra/llui/llurlaction.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/llui/llurlaction.cpp') diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index cf707d87dc..d006209284 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -170,6 +170,30 @@ std::string LLUrlAction::getUserID(std::string url) return id_str; } +std::string LLUrlAction::getObjectId(std::string url) +{ + LLURI uri(url); + LLSD path_array = uri.pathArray(); + std::string id_str; + if (path_array.size() >= 3) + { + id_str = path_array.get(2).asString(); + } + return id_str; +} + +std::string LLUrlAction::getObjectName(std::string url) +{ + LLURI uri(url); + LLSD query_map = uri.queryMap(); + std::string name; + if (query_map.has("name")) + { + name = query_map["name"]; + } + return name; +} + void LLUrlAction::sendIM(std::string url) { std::string id_str = getUserID(url); @@ -196,3 +220,13 @@ void LLUrlAction::removeFriend(std::string url) executeSLURL("secondlife:///app/agent/" + id_str + "/removefriend"); } } + +void LLUrlAction::blockObject(std::string url) +{ + std::string object_id = getObjectId(url); + std::string object_name = getObjectName(url); + if (LLUUID::validate(object_id)) + { + executeSLURL("secondlife:///app/agent/" + object_id + "/block/" + object_name); + } +} -- cgit v1.2.3