diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-27 20:07:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-27 20:08:05 +0300 |
commit | cff8879242e1f692dee58ac764c5a54da1a996cd (patch) | |
tree | d740b1a2395a9340bed8ef88b77ae3246819ab6a | |
parent | 9af27292809ee8bf42f46e214c21c305c3cd810f (diff) | |
download | plus-cff8879242e1f692dee58ac764c5a54da1a996cd.tar.gz plus-cff8879242e1f692dee58ac764c5a54da1a996cd.tar.bz2 plus-cff8879242e1f692dee58ac764c5a54da1a996cd.tar.xz plus-cff8879242e1f692dee58ac764c5a54da1a996cd.zip |
eathena: impliment packet SMSG_MAIL_SEND_MAIL_ACK.
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 18 | ||||
-rw-r--r-- | src/resources/notifications.h | 8 | ||||
-rw-r--r-- | src/resources/notifytypes.h | 2 |
3 files changed, 25 insertions, 3 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 7d7e128ce..840f53e27 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -21,6 +21,7 @@ #include "net/eathena/mailhandler.h" #include "logger.h" +#include "notifymanager.h" #include "gui/mailmessage.h" @@ -31,6 +32,8 @@ #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" +#include "resources/notifytypes.h" + #include "debug.h" extern Net::MailHandler *mailHandler; @@ -174,9 +177,18 @@ void MailHandler::processGetAttachment(Net::MessageIn &msg) void MailHandler::processSendMailAck(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readUInt8("fail flag"); + switch (msg.readUInt8("fail flag")) + { + case 0: + NotifyManager::notify(NotifyTypes::MAIL_SEND_OK); + break; + case 1: + NotifyManager::notify(NotifyTypes::MAIL_SEND_ERROR); + break; + default: + UNIMPLIMENTEDPACKET; + break; + } } void MailHandler::processNewMail(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 9ca406712..0718f7ac5 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -567,6 +567,14 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Left %d seconds until you can use item."), NotifyFlags::INT}, + {"mail send ok", + // TRANSLATORS: notification message + N_("Message succesfully sent."), + NotifyFlags::EMPTY}, + {"mail send error", + // TRANSLATORS: notification message + N_("Message send failed."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index d698734e2..8076d327c 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -160,6 +160,8 @@ namespace NotifyTypes ROOM_ERROR_HIGH_LEVEL, ROOM_ERROR_RACE, USE_ITEM_WAIT, + MAIL_SEND_OK, + MAIL_SEND_ERROR, TYPE_END }; |