summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 13:23:40 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 13:23:40 +0300
commit9761d1af134b3e699a29262abdddbe86f2b8dfe3 (patch)
tree17cf626334a326a9aaa9e328e039fc3d96a2d2a7 /src/actions
parentd53578d459fcc7fc9c5ab84a196c7f5a8238fc8e (diff)
downloadmanaverse-9761d1af134b3e699a29262abdddbe86f2b8dfe3.tar.gz
manaverse-9761d1af134b3e699a29262abdddbe86f2b8dfe3.tar.bz2
manaverse-9761d1af134b3e699a29262abdddbe86f2b8dfe3.tar.xz
manaverse-9761d1af134b3e699a29262abdddbe86f2b8dfe3.zip
Move chat command /open into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp10
-rw-r--r--src/actions/commands.h1
2 files changed, 11 insertions, 0 deletions
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
diff --git a/src/actions/commands.h b/src/actions/commands.h
index d57f3d469..3b378931d 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -57,6 +57,7 @@ namespace Actions
decHandler(addIgnoreAttack);
decHandler(setDrop);
decHandler(url);
+ decHandler(openUrl);
} // namespace Actions
#undef decHandler