summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/mail2handler.cpp15
-rw-r--r--src/net/eathena/mail2handler.h9
-rw-r--r--src/net/eathena/mail2recv.cpp22
3 files changed, 25 insertions, 21 deletions
diff --git a/src/net/eathena/mail2handler.cpp b/src/net/eathena/mail2handler.cpp
index f3ed3201d..1b19e4823 100644
--- a/src/net/eathena/mail2handler.cpp
+++ b/src/net/eathena/mail2handler.cpp
@@ -140,21 +140,20 @@ void Mail2Handler::sendMail(const std::string &to,
outMsg.writeString(body, bodySz, "body");
}
-bool Mail2Handler::queueSendMail(const std::string &to,
- const std::string &title,
- const std::string &body,
- const int64_t &money) const
+void Mail2Handler::queueCheckName(const MailQueueTypeT type,
+ const std::string &to,
+ const std::string &title,
+ const std::string &body,
+ const int64_t &money) const
{
- if (!Mail2Recv::mMailQueue.empty())
- return false;
MailQueue *const mail = new MailQueue;
mail->to = to;
mail->title = title;
mail->body = body;
mail->money = money;
- mail->sendMail = true;
+ mail->type = type;
Mail2Recv::mMailQueue.push(mail);
- return true;
+ requestCheckName(to);
}
void Mail2Handler::nextPage(const MailOpenTypeT openType,
diff --git a/src/net/eathena/mail2handler.h b/src/net/eathena/mail2handler.h
index 8e450da9d..0b7957375 100644
--- a/src/net/eathena/mail2handler.h
+++ b/src/net/eathena/mail2handler.h
@@ -48,10 +48,11 @@ class Mail2Handler final : public Net::Mail2Handler
const std::string &body,
const int64_t &money) const override final;
- bool queueSendMail(const std::string &to,
- const std::string &title,
- const std::string &body,
- const int64_t &money) const override final;
+ void queueCheckName(const MailQueueTypeT type,
+ const std::string &to,
+ const std::string &title,
+ const std::string &body,
+ const int64_t &money) const override final;
void nextPage(const MailOpenTypeT openType,
const int64_t mailId) const override final;
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp
index 1af7d47e2..04f7751a3 100644
--- a/src/net/eathena/mail2recv.cpp
+++ b/src/net/eathena/mail2recv.cpp
@@ -116,16 +116,20 @@ void Mail2Recv::processCheckNameResult(Net::MessageIn &msg)
delete mail;
return;
}
- if (mail->sendMail)
+ switch (mail->type)
{
- mail2Handler->sendMail(mail->to,
- mail->title,
- mail->body,
- mail->money);
- }
- else
- {
- reportAlways("Not implemented yet.");
+ case MailQueueType::SendMail:
+ mail2Handler->sendMail(mail->to,
+ mail->title,
+ mail->body,
+ mail->money);
+ break;
+ case MailQueueType::Unknown:
+ case MailQueueType::EditMail:
+ case MailQueueType::ValidateTO:
+ default:
+ reportAlways("Not implemented yet.");
+ break;
}
delete mail;
}