From 7e6e54c433b78ac8e33bdcad842a2cf7ec235492 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 14 Feb 2021 20:41:17 +0100 Subject: [PATCH] Simplification --- app/src/main/java/eu/faircode/email/Core.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index b76dd19955..dc4d4f0c85 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -3714,13 +3714,11 @@ class Core { if (!(message.ui_seen || message.ui_ignored || message.ui_hide)) { // This assumes the messages are properly ordered - groupMessages.get(group).add(message); - - for (int i = groupMessages.get(group).size() - 1; i >= MAX_NOTIFICATION_COUNT; i--) { - TupleMessageEx overflow = groupMessages.get(group).remove(i); - Log.i("Notify overflow=" + overflow.id); - if (!overflow.ui_ignored) - db.message().setMessageUiIgnored(overflow.id, true); + if (groupMessages.get(group).size() < MAX_NOTIFICATION_COUNT) + groupMessages.get(group).add(message); + else { + if (!message.ui_ignored) + db.message().setMessageUiIgnored(message.id, true); } } }