mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-30 17:40:34 +01:00
Prefer matching synchronizing identities
This commit is contained in:
@@ -58,7 +58,10 @@ public interface DaoIdentity {
|
||||
@Query("SELECT * FROM identity WHERE id = :id")
|
||||
EntityIdentity getIdentity(long id);
|
||||
|
||||
@Query("SELECT * FROM identity WHERE account = :account AND email = :email COLLATE NOCASE")
|
||||
@Query("SELECT * FROM identity" +
|
||||
" WHERE account = :account AND email = :email COLLATE NOCASE" +
|
||||
" ORDER BY CASE WHEN synchronize THEN 0 ELSE 1 END" +
|
||||
" LIMIT 1")
|
||||
EntityIdentity getIdentity(long account, String email);
|
||||
|
||||
@Query("SELECT COUNT(*) FROM identity WHERE synchronize")
|
||||
|
||||
Reference in New Issue
Block a user