1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-26 16:03:18 +00:00

Mark local contacts

This commit is contained in:
M66B 2020-01-23 17:48:34 +01:00
parent 891252bf3e
commit 2fc85244d5
2 changed files with 5 additions and 4 deletions

View file

@ -58,7 +58,7 @@ public interface DaoContact {
" AND email = :email COLLATE NOCASE")
EntityContact getContact(long account, int type, String email);
@Query("SELECT id AS _id, name, email" +
@Query("SELECT id AS _id, name, email, name || ' *' AS display" +
" FROM contact" +
" WHERE (:account IS NULL OR account = :account)" +
" AND (:type IS NULL OR type = :type)" +

View file

@ -668,7 +668,7 @@ public class FragmentCompose extends FragmentBase {
getContext(),
R.layout.spinner_item2_dropdown,
null,
new String[]{"name", "email"},
new String[]{"display", "email"},
new int[]{android.R.id.text1, android.R.id.text2},
0);
@ -701,7 +701,7 @@ public class FragmentCompose extends FragmentBase {
String wildcard = "%" + typed + "%";
List<Cursor> cursors = new ArrayList<>();
MatrixCursor provided = new MatrixCursor(new String[]{"_id", "name", "email"});
MatrixCursor provided = new MatrixCursor(new String[]{"_id", "name", "email", "display"});
boolean contacts = Helper.hasPermission(getContext(), Manifest.permission.READ_CONTACTS);
if (contacts) {
Cursor cursor = resolver.query(
@ -723,7 +723,8 @@ public class FragmentCompose extends FragmentBase {
provided.newRow()
.add(cursor.getLong(0))
.add(cursor.getString(1))
.add(cursor.getString(2));
.add(cursor.getString(2))
.add(cursor.getString(1));
}
cursors.add(provided);