summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/mailwindow.cpp5
-rw-r--r--src/net/eathena/mail2recv.cpp9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index 8dc54cf94..f41017543 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -151,7 +151,10 @@ void MailWindow::action(const ActionEvent &event)
if (sel < 0)
return;
const MailMessage *const mail = mMessages[sel];
- mailHandler->deleteMessage(mail->id);
+ if (mUseMail2)
+ mail2Handler->deleteMail(mOpenType, mail->id);
+ else
+ mailHandler->deleteMessage(mail->id);
}
else if (eventId == "return")
{
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp
index e3dc5b9da..32d4f76c6 100644
--- a/src/net/eathena/mail2recv.cpp
+++ b/src/net/eathena/mail2recv.cpp
@@ -444,9 +444,14 @@ void Mail2Recv::processReadMail(Net::MessageIn &msg)
void Mail2Recv::processMailDelete(Net::MessageIn &msg)
{
- UNIMPLEMENTEDPACKET;
msg.readUInt8("open type");
- msg.readInt64("mail id");
+ const int64_t mailId = msg.readInt64("mail id");
+ if (mailWindow == nullptr)
+ {
+ reportAlways("Mail window not created.");
+ return;
+ }
+ mailWindow->removeMail(mailId);
}
void Mail2Recv::processRequestMoney(Net::MessageIn &msg)