|
|
|
@ -2771,15 +2771,31 @@ class Core {
|
|
|
|
|
|
|
|
|
|
EntityLog.log(context, folder.name + " purging=" + idelete.size() + "/" + imessages.length);
|
|
|
|
|
if (account.isYahooJp()) {
|
|
|
|
|
for (Message imessage : idelete)
|
|
|
|
|
imessage.setFlag(Flags.Flag.DELETED, true);
|
|
|
|
|
for (Message imessage : new ArrayList<>(idelete))
|
|
|
|
|
try {
|
|
|
|
|
imessage.setFlag(Flags.Flag.DELETED, true);
|
|
|
|
|
} catch (MessagingException mex) {
|
|
|
|
|
Log.w(mex);
|
|
|
|
|
idelete.remove(imessage);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
int chunk_size = prefs.getInt("chunk_size", DEFAULT_CHUNK_SIZE);
|
|
|
|
|
|
|
|
|
|
Flags flags = new Flags(Flags.Flag.DELETED);
|
|
|
|
|
for (List<Message> list : Helper.chunkList(idelete, chunk_size))
|
|
|
|
|
ifolder.setFlags(list.toArray(new Message[0]), flags, true);
|
|
|
|
|
try {
|
|
|
|
|
ifolder.setFlags(list.toArray(new Message[0]), flags, true);
|
|
|
|
|
} catch (MessagingException ex) {
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
for (Message imessage : list)
|
|
|
|
|
try {
|
|
|
|
|
imessage.setFlag(Flags.Flag.DELETED, true);
|
|
|
|
|
} catch (MessagingException mex) {
|
|
|
|
|
Log.w(mex);
|
|
|
|
|
idelete.remove(imessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Log.i(folder.name + " purge deleted");
|
|
|
|
|
expunge(context, ifolder, idelete);
|
|
|
|
|