summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-13 22:03:16 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-14 00:45:05 +0300
commitb524feea03eb2594ac17d895026aad5f61fc66e9 (patch)
treea322b0b92f5716d75a7d73f7a982909d3489f44f /src/net
parent0a49b13232b36121bb19c35053bbca6eccd17ee8 (diff)
downloadplus-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.gz
plus-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.bz2
plus-b524feea03eb2594ac17d895026aad5f61fc66e9.tar.xz
plus-b524feea03eb2594ac17d895026aad5f61fc66e9.zip
Add expired field into mailmessage.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mail2recv.cpp7
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);
}