From 780731dbb1d104f3f91eede326fa7dce75b0d6f3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Apr 2015 01:05:52 +0300 Subject: eathena: impliment packet SMSG_MAIL_GET_ATTACHMENT. --- src/net/eathena/mailhandler.cpp | 18 +++++++++++++++--- src/resources/notifications.h | 12 ++++++++++++ src/resources/notifytypes.h | 3 +++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index effaf9cf2..040828e9b 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -174,9 +174,21 @@ void MailHandler::processReadMail(Net::MessageIn &msg) void MailHandler::processGetAttachment(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readUInt8("flag"); + switch(msg.readUInt8("flag")) + { + case 0: + NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_OK); + break; + case 1: + NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_ERROR); + break; + case 2: + NotifyManager::notify(NotifyTypes::MAIL_GET_ATTACH_TOO_MANY_ITEMS); + break; + default: + UNIMPLIMENTEDPACKET; + break; + } } void MailHandler::processSendMailAck(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index fe193d026..81199fcc7 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -599,6 +599,18 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Message successfully deleted."), NotifyFlags::EMPTY}, + {"mail get attach ok", + // TRANSLATORS: notification message + N_("You got attach successfully."), + NotifyFlags::EMPTY}, + {"mail get attach error", + // TRANSLATORS: notification message + N_("Error on getting attach successfully."), + NotifyFlags::EMPTY}, + {"mail get attach too many items", + // TRANSLATORS: notification message + N_("Can't get attach. Too many items."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index d80689a76..14eedf9eb 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -168,6 +168,9 @@ namespace NotifyTypes MAIL_RETURN_OK, MAIL_DELETE_ERROR, MAIL_DELETE_OK, + MAIL_GET_ATTACH_OK, + MAIL_GET_ATTACH_ERROR, + MAIL_GET_ATTACH_TOO_MANY_ITEMS, TYPE_END }; -- cgit v1.2.3-70-g09d2