summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 21:09:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 21:09:56 +0300
commit7b882f006038b0b24a86ca285afb005125dc5d2d (patch)
treea4ef7404d1c7c7691b04862c040bc89933e0b7d8 /src/actions/commands.cpp
parent67ecfd5dc5ac6b45e42f6a47263f494fa17bc46d (diff)
downloadmv-7b882f006038b0b24a86ca285afb005125dc5d2d.tar.gz
mv-7b882f006038b0b24a86ca285afb005125dc5d2d.tar.bz2
mv-7b882f006038b0b24a86ca285afb005125dc5d2d.tar.xz
mv-7b882f006038b0b24a86ca285afb005125dc5d2d.zip
Move chat command /info into actions.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp23
1 files changed, 23 insertions, 0 deletions
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