From c4e6c3f27f5ab69480f25adfdc83ae3a0a3ca0f8 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 8 Mar 2019 09:32:31 +0000 Subject: [PATCH] Case insensitive canonical email addresses --- app/src/main/java/eu/faircode/email/DaoIdentity.java | 2 +- app/src/main/java/eu/faircode/email/Helper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoIdentity.java b/app/src/main/java/eu/faircode/email/DaoIdentity.java index aa6a5fd3d5..6320ddfb65 100644 --- a/app/src/main/java/eu/faircode/email/DaoIdentity.java +++ b/app/src/main/java/eu/faircode/email/DaoIdentity.java @@ -56,7 +56,7 @@ public interface DaoIdentity { @Query("SELECT * FROM identity WHERE id = :id") EntityIdentity getIdentity(long id); - @Query("SELECT * FROM identity WHERE account = :account AND email = :email") + @Query("SELECT * FROM identity WHERE account = :account AND email = :email COLLATE NOCASE") EntityIdentity getIdentity(long account, String email); @Query("SELECT COUNT(*) FROM identity WHERE synchronize") diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index fcdfd1c363..2226c76233 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -651,7 +651,7 @@ public class Helper { if (extra.length > 0) a[0] = extra[0]; } - return TextUtils.join("@", a); + return TextUtils.join("@", a).toLowerCase(); } static void writeText(File file, String content) throws IOException {