summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-25 13:10:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-25 13:10:52 +0300
commitb063ffa91bbeb324568ae84cde9a90fbb28797f7 (patch)
tree26d6be637bde193829ce4e6ccb7d17e4c0ab6d1a /src/actions
parente62706843143949918653a03cc0cbf6620687a60 (diff)
downloadmv-b063ffa91bbeb324568ae84cde9a90fbb28797f7.tar.gz
mv-b063ffa91bbeb324568ae84cde9a90fbb28797f7.tar.bz2
mv-b063ffa91bbeb324568ae84cde9a90fbb28797f7.tar.xz
mv-b063ffa91bbeb324568ae84cde9a90fbb28797f7.zip
Move chat command /createguild into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/chat.cpp19
-rw-r--r--src/actions/chat.h1
2 files changed, 20 insertions, 0 deletions
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
diff --git a/src/actions/chat.h b/src/actions/chat.h
index 7cb453872..7bfb96aff 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -39,6 +39,7 @@ namespace Actions
decHandler(query);
decHandler(clearChatTab);
decHandler(createParty);
+ decHandler(createGuild);
} // namespace Actions
#undef decHandler