mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Select alias when multiple matching identities
This commit is contained in:
@@ -49,24 +49,23 @@ public interface DaoIdentity {
|
||||
" ORDER BY name COLLATE NOCASE")
|
||||
List<EntityIdentity> getIdentities(long account);
|
||||
|
||||
@Query("SELECT * FROM identity" +
|
||||
" WHERE account = :account" +
|
||||
" AND email = :email COLLATE NOCASE")
|
||||
List<EntityIdentity> getIdentities(long account, String email);
|
||||
|
||||
@Query("SELECT identity.* FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
" WHERE identity.account = :account" +
|
||||
" AND identity.synchronize AND account.synchronize")
|
||||
List<EntityIdentity> getSynchronizingIdentities(long account);
|
||||
|
||||
@Query("SELECT * FROM identity WHERE id = :id")
|
||||
EntityIdentity getIdentity(long id);
|
||||
|
||||
@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")
|
||||
int getSynchronizingIdentityCount();
|
||||
|
||||
@Query("SELECT * FROM identity WHERE id = :id")
|
||||
EntityIdentity getIdentity(long id);
|
||||
|
||||
@Insert
|
||||
long insertIdentity(EntityIdentity identity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user