summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-05 14:39:04 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-05 14:39:04 +0300
commit53606350048c2145b104cfc09af838db387bdce2 (patch)
treedc7479610f3fffb98e7a868400149ef7b5767392 /src/actions
parentdc706af3765b75330e4e7c557ea3e4cf1f119631 (diff)
downloadplus-53606350048c2145b104cfc09af838db387bdce2.tar.gz
plus-53606350048c2145b104cfc09af838db387bdce2.tar.bz2
plus-53606350048c2145b104cfc09af838db387bdce2.tar.xz
plus-53606350048c2145b104cfc09af838db387bdce2.zip
Allow send quick mail message by command /sendmail (hercules)
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp17
1 files changed, 17 insertions, 0 deletions
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);