summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-23 01:12:26 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-23 01:12:26 +0300
commit75604ffe8c2ef1f2d76a44dc30e8a257b695daf5 (patch)
tree5cb43dcb41627d3313ba3d2a371b1a597fd3bab5 /src/actions/commands.cpp
parent17e9519c2ee0b126db5ba1df61dcddf9f7b90b47 (diff)
downloadplus-75604ffe8c2ef1f2d76a44dc30e8a257b695daf5.tar.gz
plus-75604ffe8c2ef1f2d76a44dc30e8a257b695daf5.tar.bz2
plus-75604ffe8c2ef1f2d76a44dc30e8a257b695daf5.tar.xz
plus-75604ffe8c2ef1f2d76a44dc30e8a257b695daf5.zip
Add ability to send new mail by /sendmail chat command.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index a415a2117..18560f8df 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -63,6 +63,7 @@
#include "net/guildhandler.h"
#include "net/familyhandler.h"
#include "net/homunculushandler.h"
+#include "net/mail2handler.h"
#include "net/mailhandler.h"
#include "net/net.h"
#include "net/npchandler.h"
@@ -555,22 +556,41 @@ impHandler(imitation)
impHandler(sendMail)
{
const ServerTypeT type = Net::getNetworkType();
+#ifdef TMWA_SUPPORT
if (type == ServerType::EATHENA || type == ServerType::EVOL2)
+#endif // TMWA_SUPPORT
{
std::string name;
std::string text;
if (parse2Str(event.args, name, text))
{
- // TRANSLATORS: quick mail message caption
- mailHandler->send(name, _("Quick message"), text);
+ if (settings.enableNewMailSystem)
+ {
+ if (mail2Handler->queueSendMail(name,
+ // TRANSLATORS: quick mail message caption
+ _("Quick message"),
+ text,
+ 0))
+ {
+ mail2Handler->requestCheckName(name);
+ }
+ }
+ else
+ {
+ // TRANSLATORS: quick mail message caption
+ mailHandler->send(name, _("Quick message"), text);
+ }
}
}
+#ifdef TMWA_SUPPORT
else if (serverConfig.getBoolValue("enableManaMarketBot"))
{
chatHandler->privateMessage("ManaMarket", "!mail " + event.args);
return true;
}
+#endif // TMWA_SUPPORT
+
return false;
}