diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-05 20:22:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-05 20:22:00 +0300 |
commit | bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83 (patch) | |
tree | 28bfbcce0f7f34db5a42c7a27dfdac3a75b80e14 /src/actions | |
parent | 84b6217136c8d59347ab9f28ec5e9e4d718d5058 (diff) | |
download | mv-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.gz mv-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.bz2 mv-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.tar.xz mv-bd44e8d0a94dd96e6f8eb0828b4f2b5de902ee83.zip |
add chat command for join chat room.
New chat command: /joinroom NAME
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/commands.cpp | 17 | ||||
-rw-r--r-- | src/actions/commands.h | 1 |
2 files changed, 18 insertions, 0 deletions
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 diff --git a/src/actions/commands.h b/src/actions/commands.h index f5fa4344b..ef02a70eb 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -83,6 +83,7 @@ namespace Actions decHandler(homunEmote); decHandler(commandHomunEmote); decHandler(createPublicChatRoom); + decHandler(joinChatRoom); } // namespace Actions #undef decHandler |