diff options
Diffstat (limited to 'src/net/eathena/mailhandler.cpp')
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index cf4fb90d4..95c729c9b 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -40,6 +40,7 @@ MailHandler::MailHandler() : static const uint16_t _messages[] = { SMSG_MAIL_OPEN_WINDOW, + SMSG_MAIL_MAILS_LIST, 0 }; handledMessages = _messages; @@ -54,6 +55,10 @@ void MailHandler::handleMessage(Net::MessageIn &msg) processMailOpen(msg); break; + case SMSG_MAIL_MAILS_LIST: + processMailList(msg); + break; + default: break; } @@ -77,6 +82,24 @@ void MailHandler::processMailOpen(Net::MessageIn &msg) } } +void MailHandler::processMailList(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + + const int count = (msg.readInt16("len") - 8) / 73; + const int amount = msg.readInt32("amount"); + if (count != amount) + logger->log("error: wrong mails count"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("message id"); + msg.readString(40, "title"); + msg.readUInt8("unread flag"); + msg.readString(24, "sender name"); + msg.readInt32("time stamp"); + } +} + void MailHandler::refresh() { createOutPacket(CMSG_MAIL_REFRESH_INBOX); |