From 718714eef1dd302a9426689fff71fd9c13fbacdf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Aug 2016 20:42:53 +0300 Subject: Use input manager for most commands in guild tab. --- src/gui/widgets/tabs/chat/guildtab.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/gui/widgets/tabs/chat') diff --git a/src/gui/widgets/tabs/chat/guildtab.cpp b/src/gui/widgets/tabs/chat/guildtab.cpp index 4a29d1d31..416a90aa1 100644 --- a/src/gui/widgets/tabs/chat/guildtab.cpp +++ b/src/gui/widgets/tabs/chat/guildtab.cpp @@ -27,10 +27,12 @@ #include "const/sound.h" -#include "net/guildhandler.h" - #include "gui/windows/chatwindow.h" +#include "input/inputmanager.h" + +#include "net/guildhandler.h" + #include "utils/gettext.h" #include "debug.h" @@ -64,19 +66,21 @@ bool GuildTab::handleCommand(const std::string &restrict type, } else if (type == "leave" && Ea::taGuild) { - guildHandler->leave(Ea::taGuild->getId()); + inputManager.executeChatCommand(InputAction::LEAVE_GUILD, + std::string(), + this); } else if (type == "kick" && Ea::taGuild) { - guildHandler->kick(Ea::taGuild->getMember(args), ""); + inputManager.executeChatCommand(InputAction::KICK_GUILD, + args, + this); } else if (type == "notice" && Ea::taGuild) { - std::string str1 = args.substr(0, 60); - std::string str2(""); - if (args.size() > 60) - str2 = args.substr(60); - guildHandler->changeNotice(Ea::taGuild->getId(), str1, str2); + inputManager.executeChatCommand(InputAction::GUILD_NOTICE, + args, + this); } else { -- cgit v1.2.3-70-g09d2