From 1353013f6585e0f547f906dd6e0a818dba0c1829 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 1 Sep 2022 07:25:40 +0200 Subject: [PATCH] Prevent duplicate warnings --- .../main/java/eu/faircode/email/MessageHelper.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index e35e213c5f..453a3e028d 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -4065,8 +4065,17 @@ public class MessageHelper { } String getWarnings(String existing) { - if (existing != null) - warnings.add(0, existing); + if (existing != null) { + boolean exists = false; + for (String warning : warnings) + if (existing.equals(warning)) { + exists = true; + break; + } + if (!exists) + warnings.add(0, existing); + } + if (warnings.size() == 0) return null; else