From 35cc06d7d72c0b068174a8c779ace8edeeed508b Mon Sep 17 00:00:00 2001 From: Fahim Date: Thu, 27 Jan 2022 17:59:48 +0600 Subject: [PATCH] 3787-Block_duplicate_recipient_entry_from_compose_page issue: https://gitlab.e.foundation/e/backlog/-/issues/3787 --- .../src/main/java/com/fsck/k9/view/RecipientSelectView.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/RecipientSelectView.java b/app/ui/legacy/src/main/java/com/fsck/k9/view/RecipientSelectView.java index 72e46e091e..9a160a5edc 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/RecipientSelectView.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/RecipientSelectView.java @@ -404,6 +404,7 @@ public class RecipientSelectView extends TokenCompleteTextView implem switch (loader.getId()) { case LOADER_ID_FILTERING: { + data.removeAll(getObjects()); adapter.setRecipients(data); break; } @@ -459,6 +460,9 @@ public class RecipientSelectView extends TokenCompleteTextView implem alternatesPopup.dismiss(); List currentRecipients = getObjects(); + if (currentRecipients.contains(alternateAddress)) { + return; + } int indexOfRecipient = currentRecipients.indexOf(recipientToReplace); if (indexOfRecipient == -1) { Timber.e("Tried to refresh invalid view token!"); -- GitLab