From 856d04d79ef1b1a42bc704eb7a9d8f8896b537c7 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Apr 2019 11:59:28 +0200 Subject: [PATCH] Fixed collation --- app/src/main/java/eu/faircode/email/Core.java | 4 ++-- app/src/main/java/eu/faircode/email/DaoContact.java | 2 +- app/src/main/java/eu/faircode/email/FragmentIdentity.java | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 094f73b91f..71f2f7ccad 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1376,7 +1376,7 @@ class Core { String email = ((InternetAddress) reply).getAddress(); String canonical = Helper.canonicalAddress(email); if (!TextUtils.isEmpty(email) && - db.identity().getIdentity(folder.account, email.toLowerCase()) == null && + db.identity().getIdentity(folder.account, email) == null && (canonical.equals(email) || db.identity().getIdentity(folder.account, canonical) == null)) { me = false; @@ -1388,7 +1388,7 @@ class Core { } for (Address recipient : recipients) { - String email = ((InternetAddress) recipient).getAddress().toLowerCase(); + String email = ((InternetAddress) recipient).getAddress(); String name = ((InternetAddress) recipient).getPersonal(); Uri avatar = ContactInfo.getLookupUri(context, new Address[]{recipient}); EntityContact contact = db.contact().getContact(folder.account, type, email); diff --git a/app/src/main/java/eu/faircode/email/DaoContact.java b/app/src/main/java/eu/faircode/email/DaoContact.java index 756e6bbb8f..9673700d48 100644 --- a/app/src/main/java/eu/faircode/email/DaoContact.java +++ b/app/src/main/java/eu/faircode/email/DaoContact.java @@ -55,7 +55,7 @@ public interface DaoContact { " FROM contact" + " WHERE account = :account" + " AND type = :type" + - " AND email = :email") + " AND email = :email COLLATE NOCASE") EntityContact getContact(long account, int type, String email); @Query("SELECT id AS _id, name, email" + diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 56a27b3e64..96255aa9e3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -586,8 +586,6 @@ public class FragmentIdentity extends FragmentBase { if (synchronize && TextUtils.isEmpty(password) && !insecure) throw new IllegalArgumentException(context.getString(R.string.title_no_password)); - email = email.toLowerCase(); - if (TextUtils.isEmpty(display)) display = null; @@ -596,13 +594,9 @@ public class FragmentIdentity extends FragmentBase { if (TextUtils.isEmpty(replyto)) replyto = null; - else - replyto = replyto.toLowerCase(); if (TextUtils.isEmpty(bcc)) bcc = null; - else - bcc = bcc.toLowerCase(); if (Color.TRANSPARENT == color) color = null;