diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-25 13:04:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-25 13:04:02 +0300 |
commit | e62706843143949918653a03cc0cbf6620687a60 (patch) | |
tree | 648b609d88e7e642d6ecd0007780aaee03ee92db /src/actions | |
parent | 4c0d3dc62399e35c288cb82dfbf3f8811328f06c (diff) | |
download | manaplus-e62706843143949918653a03cc0cbf6620687a60.tar.gz manaplus-e62706843143949918653a03cc0cbf6620687a60.tar.bz2 manaplus-e62706843143949918653a03cc0cbf6620687a60.tar.xz manaplus-e62706843143949918653a03cc0cbf6620687a60.zip |
Move chat command /createparty into actions.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/chat.cpp | 20 | ||||
-rw-r--r-- | src/actions/chat.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 74f3fc691..22d31fbb9 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -68,6 +68,9 @@ #include "gui/widgets/tabs/chattab.h" +#include "net/net.h" +#include "net/partyhandler.h" + #include "utils/gettext.h" #include "utils/stringutils.h" @@ -242,4 +245,21 @@ impHandler0(clearChatTab) return false; } +impHandler(createParty) +{ + if (!event.tab) + return false; + + if (event.args.empty()) + { + // TRANSLATORS: create party message + event.tab->chatLog(_("Party name is missing."), ChatMsgType::BY_SERVER); + } + else + { + Net::getPartyHandler()->create(event.args); + } + return true; +} + } // namespace Actions diff --git a/src/actions/chat.h b/src/actions/chat.h index 8a5e3a3c8..7cb453872 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -38,6 +38,7 @@ namespace Actions decHandler(msg); decHandler(query); decHandler(clearChatTab); + decHandler(createParty); } // namespace Actions #undef decHandler |