From ca9379c8d85fa23469090a3d60700fe0f0913d0e Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 25 Oct 2021 08:58:11 +0200 Subject: [PATCH] Improved logging --- app/src/main/java/eu/faircode/email/Core.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index d001473955..dbaeb2a0fe 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -4038,13 +4038,23 @@ class Core { try { boolean uidplus = MessageHelper.hasCapability(ifolder, "UIDPLUS"); - String count = (uidplus ? messages.size() : "all") + "messages"; - Log.i(ifolder.getName() + " expunging " + count); - if (uidplus) + if (uidplus) { + List uids = new ArrayList<>(); + for (Message m : messages) + try { + uids.add(ifolder.getUID(m)); + } catch (MessagingException ex) { + uids.add(-1L); + } + Log.i(ifolder.getName() + " expunging " + TextUtils.join(",", uids)); ifolder.expunge(messages.toArray(new Message[0])); - else + Log.i(ifolder.getName() + " expunged " + TextUtils.join(",", uids)); + } else { + Log.i(ifolder.getName() + " expunging all"); ifolder.expunge(); - Log.i(ifolder.getName() + " expunged " + count); + Log.i(ifolder.getName() + " expunged all"); + } + return true; } catch (MessagingException ex) { // NO EXPUNGE failed.