From 53606350048c2145b104cfc09af838db387bdce2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 5 Sep 2015 14:39:04 +0300 Subject: Allow send quick mail message by command /sendmail (hercules) --- src/actions/commands.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 0f34689ee..ed017a74c 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -52,6 +52,8 @@ #include "net/guildhandler.h" #ifdef EATHENA_SUPPORT #include "net/homunculushandler.h" +#include "net/mailhandler.h" +#include "net/net.h" #endif #include "net/partyhandler.h" #include "net/serverfeatures.h" @@ -518,6 +520,21 @@ impHandler(imitation) impHandler0(sendMail) { // +++ need impliment for hercules + const ServerTypeT type = Net::getNetworkType(); +#ifdef EATHENA_SUPPORT + if (type == ServerType::EATHENA || type == ServerType::EVOL2) + { + std::string name; + std::string text; + + if (parse2Str(event.args, name, text)) + { + // TRANSLATORS: quick mail message caption + mailHandler->send(name, _("Quick message"), text); + } + } + else +#endif if (serverConfig.getBoolValue("enableManaMarketBot")) { chatHandler->privateMessage("ManaMarket", "!mail " + event.args); -- cgit v1.2.3-60-g2f50