Search TextSecure contacts by name or number.

Fixes #3710
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-07-20 16:41:05 -07:00
parent f22c9af136
commit f4104f696e

View File

@ -224,9 +224,9 @@ public class ContactsDatabase {
} else {
cursor = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI,
projection,
ContactsContract.Data.MIMETYPE + " = ? AND " + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ?",
ContactsContract.Data.MIMETYPE + " = ? AND (" + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ? OR " + ContactsContract.Data.DATA1 + " LIKE ?)",
new String[] {"vnd.android.cursor.item/vnd.org.thoughtcrime.securesms.contact",
"%" + filter + "%"},
"%" + filter + "%", "%" + filter + "%"},
sort);
}