From bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Apr 2015 20:22:00 +0300 Subject: add chat command for join chat room. New chat command: /joinroom NAME --- src/actions/commands.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/actions/commands.cpp') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 76d94886c..18206b9a3 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -55,6 +55,7 @@ #include "net/serverfeatures.h" #include "resources/iteminfo.h" +#include "resources/chatobject.h" #include "utils/chatutils.h" #include "utils/gettext.h" @@ -881,4 +882,20 @@ impHandler(createPublicChatRoom) #endif } +impHandler(joinChatRoom) +{ +#ifdef EATHENA_SUPPORT + const std::string args = event.args; + if (args.empty()) + return false; + ChatObject *const chat = ChatObject::findByName(args); + if (!chat) + return false; + chatHandler->joinChat(chat, ""); + return true; +#else + return false; +#endif +} + } // namespace Actions -- cgit v1.2.3-60-g2f50