From 9761d1af134b3e699a29262abdddbe86f2b8dfe3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Aug 2014 13:23:40 +0300 Subject: Move chat command /open into actions. --- src/actions/commands.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/actions/commands.cpp') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index ab116d805..28b601ba2 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -77,6 +77,7 @@ #include "utils/chatutils.h" #include "utils/gettext.h" +#include "utils/process.h" #include "utils/stringutils.h" #include "debug.h" @@ -546,4 +547,13 @@ impHandler(url) return false; } +impHandler(openUrl) +{ + std::string url = event.args; + if (!strStartWith(url, "http")) + url = "http://" + url; + openBrowser(url); + return true; +} + } // namespace Actions -- cgit v1.2.3-70-g09d2