JavaMail: fixed VANISH range

pull/215/head
M66B 4 months ago
parent d7f55f2ac2
commit 601e52f129

@ -3644,8 +3644,9 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
long[] luid = UIDSet.toArray(uidset);
Message[] msgs = createMessagesForUIDs(luid);
for (Message m : msgs) {
if (m.getMessageNumber() > 0)
messageCache.expungeMessage(m.getMessageNumber());
// Avoid creating seqnums
if (m != null)
((IMAPMessage)m).setExpunged(true);
}
if (doExpungeNotification && hasMessageCountListener) {
notifyMessageRemovedListeners(true, msgs);

@ -217,8 +217,8 @@ public class MessageCache {
int newnum = 1;
while (oldnum <= size) {
// is message expunged?
if (seqnumOf(oldnum) <= 0) {
IMAPMessage m = getMessage(oldnum);
if (seqnumOf(oldnum) <= 0 || (m !=null && m.isExpunged())) {
mlist.add(m);
} else {
// keep this message

Loading…
Cancel
Save