From 7b882f006038b0b24a86ca285afb005125dc5d2d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Aug 2014 21:09:56 +0300 Subject: Move chat command /info into actions. --- src/actions/commands.cpp | 23 +++++++++++++++++++++++ src/actions/commands.h | 1 + 2 files changed, 24 insertions(+) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 6e8fca4a0..2e0f8d6fe 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -71,6 +71,7 @@ #include "gui/widgets/tabs/whispertab.h" #include "net/adminhandler.h" +#include "net/guildhandler.h" #include "net/pethandler.h" #include "net/net.h" @@ -79,6 +80,8 @@ #include "debug.h" +extern unsigned int tmwServerVersion; + namespace Actions { @@ -434,4 +437,24 @@ impHandler(sendMail) return false; } +impHandler(info) +{ + if (!event.tab || !localPlayer || tmwServerVersion > 0) + return false; + + switch (event.tab->getType()) + { + case ChatTabType::GUILD: + { + const Guild *const guild = localPlayer->getGuild(); + if (guild) + Net::getGuildHandler()->info(guild->getId()); + break; + } + default: + break; + } + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 98f13b2d5..d0730fe01 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -49,6 +49,7 @@ namespace Actions decHandler(navigate); decHandler(imitation); decHandler(sendMail); + decHandler(info); } // namespace Actions #undef decHandler -- cgit v1.2.3-70-g09d2