summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-18 20:39:30 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-18 20:39:30 +0300
commit261edddd92ec02c1d278213e730aa30a1fea71d0 (patch)
tree7ab51a50a43735d476ac276a00a592799adff6b6 /src/commandhandler.cpp
parent110815cb875c0ceb76c1c37263f4b5fe09a927b6 (diff)
downloadplus-261edddd92ec02c1d278213e730aa30a1fea71d0.tar.gz
plus-261edddd92ec02c1d278213e730aa30a1fea71d0.tar.bz2
plus-261edddd92ec02c1d278213e730aa30a1fea71d0.tar.xz
plus-261edddd92ec02c1d278213e730aa30a1fea71d0.zip
Remove static list with chat commands for autocomplete.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index d769f121f..8edea1666 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -43,6 +43,23 @@ CommandHandler::CommandHandler() :
}
}
+void CommandHandler::addChatCommands(std::list<std::string> &arr)
+{
+ const int sz = sizeof(commands) / sizeof(CommandInfo);
+ for (int f = 0; f < sz; f ++)
+ {
+ const CommandInfo &info = commands[f];
+ const std::string name = info.name;
+ if (!name.empty())
+ {
+ std::string cmd = std::string("/").append(name);
+ if (info.useArgs)
+ cmd.append(" ");
+ arr.push_back(cmd);
+ }
+ }
+}
+
void CommandHandler::handleCommands(const std::string &command,
ChatTab *const tab)
{