From e62706843143949918653a03cc0cbf6620687a60 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 13:04:02 +0300 Subject: Move chat command /createparty into actions. --- src/actions/chat.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/actions/chat.cpp') 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 -- cgit v1.2.3-70-g09d2