summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 13:27:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 13:27:52 +0300
commitd003da4b7bbf1b37f95c2e8e761fbe3e54b25c7a (patch)
treebf4d4529ef1319e52fa1dd9534884c97bb4c2849 /src/actions
parent9761d1af134b3e699a29262abdddbe86f2b8dfe3 (diff)
downloadplus-d003da4b7bbf1b37f95c2e8e761fbe3e54b25c7a.tar.gz
plus-d003da4b7bbf1b37f95c2e8e761fbe3e54b25c7a.tar.bz2
plus-d003da4b7bbf1b37f95c2e8e761fbe3e54b25c7a.tar.xz
plus-d003da4b7bbf1b37f95c2e8e761fbe3e54b25c7a.zip
Move chat command /execute into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp18
-rw-r--r--src/actions/commands.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 28b601ba2..dbf3ab3d4 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -556,4 +556,22 @@ impHandler(openUrl)
return true;
}
+impHandler(execute)
+{
+ const size_t idx = event.args.find(" ");
+ std::string name;
+ std::string params;
+ if (idx == std::string::npos)
+ {
+ name = event.args;
+ }
+ else
+ {
+ name = event.args.substr(0, idx);
+ params = event.args.substr(idx + 1);
+ }
+ execFile(name, name, params, "");
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 3b378931d..0a803e41c 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -58,6 +58,7 @@ namespace Actions
decHandler(setDrop);
decHandler(url);
decHandler(openUrl);
+ decHandler(execute);
} // namespace Actions
#undef decHandler