diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-30 13:00:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-30 13:00:48 +0300 |
commit | 11e63a9fe8496302dc789c74b2b6ba39a14b568a (patch) | |
tree | 21525c638446ce670244bbc3431f9e00fb75e632 | |
parent | 7b8493a8a977032b502e6df00b89f6b1a813b78b (diff) | |
download | manaplus-11e63a9fe8496302dc789c74b2b6ba39a14b568a.tar.gz manaplus-11e63a9fe8496302dc789c74b2b6ba39a14b568a.tar.bz2 manaplus-11e63a9fe8496302dc789c74b2b6ba39a14b568a.tar.xz manaplus-11e63a9fe8496302dc789c74b2b6ba39a14b568a.zip |
Impliment packet SMSG_MAIL_NEW_MAIL.
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 10 | ||||
-rw-r--r-- | src/resources/notifications.h | 4 | ||||
-rw-r--r-- | src/resources/notifytypes.h | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 040828e9b..68a3a2e67 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -34,6 +34,7 @@ #include "resources/notifytypes.h" +#include "utils/gettext.h" #include "utils/stringutils.h" #include "debug.h" @@ -209,11 +210,12 @@ void MailHandler::processSendMailAck(Net::MessageIn &msg) void MailHandler::processNewMail(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readInt32("message id"); - msg.readString(40, "title"); - msg.readString(24, "sender name"); + const std::string subj = msg.readString(40, "title"); + const std::string sender = msg.readString(24, "sender name"); + NotifyManager::notify(NotifyTypes::NEW_MAIL, + strprintf(_("You have new mail from %s with subject %s"), + sender.c_str(), subj.c_str())); } void MailHandler::processSetAttachmentAck(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 81199fcc7..69cb6a205 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -611,6 +611,10 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Can't get attach. Too many items."), NotifyFlags::EMPTY}, + {"new mail", + // TRANSLATORS: notification message + "%s", + NotifyFlags::STRING}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index 14eedf9eb..1c132e876 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -171,6 +171,7 @@ namespace NotifyTypes MAIL_GET_ATTACH_OK, MAIL_GET_ATTACH_ERROR, MAIL_GET_ATTACH_TOO_MANY_ITEMS, + NEW_MAIL, TYPE_END }; |