diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-13 22:03:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-14 00:45:05 +0300 |
commit | b524feea03eb2594ac17d895026aad5f61fc66e9 (patch) | |
tree | a322b0b92f5716d75a7d73f7a982909d3489f44f /src/net/eathena/mail2recv.cpp | |
parent | 0a49b13232b36121bb19c35053bbca6eccd17ee8 (diff) | |
download | mv-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.gz mv-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.bz2 mv-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.xz mv-b524feea03eb2594ac17d895026aad5f61fc66e9.zip |
Add expired field into mailmessage.
Diffstat (limited to 'src/net/eathena/mail2recv.cpp')
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index 7e3ed631e..5c1db8de6 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -337,6 +337,7 @@ void Mail2Recv::processMailListPage(Net::MessageIn &msg) } msg.readInt16("len"); bool isEnd = true; + if (packetVersion < 20170419) { mailWindow->setOpenType(fromInt(msg.readUInt8("open type"), @@ -356,7 +357,8 @@ void Mail2Recv::processMailListPage(Net::MessageIn &msg) mail->time = CAST_S32(cur_time - msg.readInt32("reg time")); mail->strTime = timeToStr(mail->time); } - mail->expireTime = msg.readInt32("expire time"); + mail->expireTime = msg.readInt32("expire time") + cur_time; + mail->expired = mail->expireTime <= 0; mail->title = msg.readString(-1, "title"); mailWindow->addMail(mail); } @@ -375,7 +377,8 @@ void Mail2Recv::processMailListPage(Net::MessageIn &msg) msg.readUInt8("type")); mail->sender = msg.readString(24, "sender name"); mail->strTime = "-"; - mail->expireTime = msg.readInt32("expire time"); + mail->expireTime = msg.readInt32("expire time") + cur_time; + mail->expired = mail->expireTime <= 0; mail->title = msg.readString(-1, "title"); mailWindow->addMail(mail); } |