From b063ffa91bbeb324568ae84cde9a90fbb28797f7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 13:10:52 +0300 Subject: Move chat command /createguild into actions. --- src/actions/chat.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/actions/chat.cpp') diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 22d31fbb9..58642db29 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -68,6 +68,7 @@ #include "gui/widgets/tabs/chattab.h" +#include "net/guildhandler.h" #include "net/net.h" #include "net/partyhandler.h" @@ -79,6 +80,7 @@ extern ShortcutWindow *spellShortcutWindow; extern std::string tradePartnerName; extern QuitDialog *quitDialog; +extern unsigned int tmwServerVersion; namespace Actions { @@ -262,4 +264,21 @@ impHandler(createParty) return true; } +impHandler(createGuild) +{ + if (!event.tab || tmwServerVersion > 0) + return false; + + if (event.args.empty()) + { + // TRANSLATORS: create guild message + event.tab->chatLog(_("Guild name is missing."), ChatMsgType::BY_SERVER); + } + else + { + Net::getGuildHandler()->create(event.args); + } + return true; +} + } // namespace Actions -- cgit v1.2.3-60-g2f50