Contact: store last used identity

This commit is contained in:
M66B
2022-04-18 23:12:24 +02:00
parent 7764b6450f
commit 0431c7c27c
10 changed files with 2776 additions and 12 deletions

View File

@@ -35,9 +35,10 @@ public interface DaoContact {
" WHERE account = :account")
List<EntityContact> getContacts(long account);
@Query("SELECT contact.*, account.name AS accountName" +
@Query("SELECT contact.*, account.name AS accountName, identity.email AS identityEmail" +
" FROM contact" +
" JOIN account ON account.id = contact.account" +
" LEFT JOIN identity ON identity.id = contact.identity" +
" WHERE (:account IS NULL OR contact.account = :account)" +
" ORDER BY times_contacted DESC, last_contacted DESC")
LiveData<List<TupleContactEx>> liveContacts(Long account);