mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 08:47:46 +00:00
update contact query
update query to remove duplicated numbers Fixes #4191 Closes #6475
This commit is contained in:
parent
12ce92bb83
commit
dc18f73594
@ -161,9 +161,11 @@ public class ContactsDatabase {
|
||||
put(LABEL_COLUMN, ContactsContract.CommonDataKinds.Phone.LABEL);
|
||||
}};
|
||||
|
||||
String excludeSelection = ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " NOT IN (" +
|
||||
"SELECT data.contact_id FROM raw_contacts, view_data data WHERE raw_contacts._id = data.raw_contact_id AND " +
|
||||
"data.mimetype = '" + CONTACT_MIMETYPE + "')";
|
||||
String formattedNumber = "REPLACE(REPLACE(REPLACE(REPLACE(data1,' ',''),'-',''),'(',''),')','')";
|
||||
String excludeSelection = "(" + formattedNumber +" NOT IN " +
|
||||
"(SELECT data1 FROM view_data WHERE "+formattedNumber+" = data1) " +
|
||||
"OR "+formattedNumber+" = data1)" +
|
||||
"AND " + formattedNumber + "NOT IN (SELECT "+formattedNumber+" FROM view_data where mimetype = '"+CONTACT_MIMETYPE+"')" ;
|
||||
|
||||
String fallbackSelection = ContactsContract.Data.SYNC2 + " IS NULL OR " + ContactsContract.Data.SYNC2 + " != '" + SYNC + "'";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user