From cf129acd3bc226581cb466b5c5896f1c360509f2 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 15 Nov 2018 07:26:49 +0100 Subject: [PATCH] Fixed error message --- .../java/eu/faircode/email/ViewModelBrowse.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ViewModelBrowse.java b/app/src/main/java/eu/faircode/email/ViewModelBrowse.java index bbb1478792..86544222db 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelBrowse.java +++ b/app/src/main/java/eu/faircode/email/ViewModelBrowse.java @@ -114,12 +114,15 @@ public class ViewModelBrowse extends ViewModel { match = body.toLowerCase().contains(find); if (match) { - matched++; - message.id = null; - message.ui_found = true; - message.id = db.message().insertMessage(message); - if (message.content) - message.write(state.context, body); + EntityMessage exists = db.message().getMessageByUid(state.fid, message.uid, state.search != null); + if (exists == null) { + matched++; + message.id = null; + message.ui_found = true; + message.id = db.message().insertMessage(message); + if (message.content) + message.write(state.context, body); + } } }