fix(Core/Mail): do not show expired mails in packets (#10560)

Fixed #5920
This commit is contained in:
UltraNix
2022-03-01 13:57:37 +01:00
committed by GitHub
parent 66b95f8d9d
commit 73957b95f6
8 changed files with 13 additions and 69 deletions

View File

@@ -626,7 +626,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData)
}
// skip deleted or not delivered (deliver delay not expired) mails
if (mail->state == MAIL_STATE_DELETED || cur_time < mail->deliver_time)
if (mail->state == MAIL_STATE_DELETED || cur_time < mail->deliver_time || cur_time > mail->expire_time)
{
continue;
}
@@ -811,8 +811,8 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket& /*recvData*/)
if (mail->checked & MAIL_CHECK_MASK_READ)
continue;
// and already delivered
if (now < mail->deliver_time)
// and already delivered or expired
if (now < mail->deliver_time || now > mail->expire_time)
continue;
// only send each mail sender once