JavaMail: fixed VANISH range

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

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

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

Loading…
Cancel
Save