Revert "Selective expunged when UIDPLUS"

This reverts commit c0dd77e44c.
pull/185/head
M66B 4 years ago
parent 62614e4d9d
commit d187e392d0

@ -588,10 +588,7 @@ class Core {
try { try {
Log.i(name + " deleting uid=" + muid + " for msgid=" + msgid); Log.i(name + " deleting uid=" + muid + " for msgid=" + msgid);
iexisting.setFlag(Flags.Flag.DELETED, true); iexisting.setFlag(Flags.Flag.DELETED, true);
if (MessageHelper.hasCapability(ifolder, "UIDPLUS")) purged = true;
ifolder.expunge(new Message[]{iexisting});
else
purged = true;
} catch (MessageRemovedException ignored) { } catch (MessageRemovedException ignored) {
Log.w(name + " existing gone uid=" + muid + " for msgid=" + msgid); Log.w(name + " existing gone uid=" + muid + " for msgid=" + msgid);
} }
@ -763,10 +760,7 @@ class Core {
if (imessage == null) if (imessage == null)
throw new MessageRemovedException(); throw new MessageRemovedException();
imessage.setFlag(Flags.Flag.DELETED, true); imessage.setFlag(Flags.Flag.DELETED, true);
if (MessageHelper.hasCapability(ifolder, "UIDPLUS")) ifolder.expunge();
ifolder.expunge(new Message[]{imessage});
else
ifolder.expunge();
} catch (MessagingException ex) { } catch (MessagingException ex) {
Log.w(ex); Log.w(ex);
} }
@ -904,13 +898,10 @@ class Core {
try { try {
Log.i(folder.name + " deleting uid=" + message.uid); Log.i(folder.name + " deleting uid=" + message.uid);
iexisting.setFlag(Flags.Flag.DELETED, true); iexisting.setFlag(Flags.Flag.DELETED, true);
if (MessageHelper.hasCapability(ifolder, "UIDPLUS"))
ifolder.expunge(new Message[]{iexisting});
else
ifolder.expunge();
} catch (MessageRemovedException ignored) { } catch (MessageRemovedException ignored) {
Log.w(folder.name + " existing gone uid=" + message.uid); Log.w(folder.name + " existing gone uid=" + message.uid);
} }
ifolder.expunge();
} }
} }
@ -1027,13 +1018,9 @@ class Core {
try { try {
for (Message imessage : map.keySet()) for (Message imessage : map.keySet())
imessage.setFlag(Flags.Flag.DELETED, true); imessage.setFlag(Flags.Flag.DELETED, true);
if (MessageHelper.hasCapability(ifolder, "UIDPLUS")) } catch (MessageRemovedException ignored) {
ifolder.expunge(map.keySet().toArray(new Message[0]));
else
ifolder.expunge();
} catch (MessageRemovedException ex) {
Log.w(ex);
} }
ifolder.expunge();
} else { } else {
int count = MessageHelper.getMessageCount(ifolder); int count = MessageHelper.getMessageCount(ifolder);
db.folder().setFolderTotal(folder.id, count < 0 ? null : count); db.folder().setFolderTotal(folder.id, count < 0 ? null : count);
@ -1240,7 +1227,7 @@ class Core {
Message[] imessages = ifolder.search(new MessageIDTerm(message.msgid)); Message[] imessages = ifolder.search(new MessageIDTerm(message.msgid));
if (imessages == null) if (imessages == null)
Log.w(folder.name + " search for msgid=" + message.msgid + " returned null"); Log.w(folder.name + " search for msgid=" + message.msgid + " returned null");
else { else
for (Message iexisting : imessages) { for (Message iexisting : imessages) {
long muid = ifolder.getUID(iexisting); long muid = ifolder.getUID(iexisting);
Log.i(folder.name + " deleting uid=" + muid); Log.i(folder.name + " deleting uid=" + muid);
@ -1250,13 +1237,10 @@ class Core {
Log.w(folder.name + " existing gone uid=" + muid); Log.w(folder.name + " existing gone uid=" + muid);
} }
} }
if (MessageHelper.hasCapability(ifolder, "UIDPLUS"))
ifolder.expunge(imessages);
else
ifolder.expunge();
}
} }
ifolder.expunge();
db.message().deleteMessage(message.id); db.message().deleteMessage(message.id);
} finally { } finally {
int count = MessageHelper.getMessageCount(ifolder); int count = MessageHelper.getMessageCount(ifolder);

Loading…
Cancel
Save