From 542e1984c1a5d1816c8469183bc6b44e44e181f9 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 6 May 2014 02:14:44 -0500 Subject: [PATCH] sanely handle duplicate contacts in db // FREEBIE --- src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java index b42b6d699d..93208d36b8 100644 --- a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java +++ b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java @@ -214,7 +214,7 @@ public class ContactsDatabase { values.put(NUMBER_TYPE_COLUMN, ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM); values.put(NUMBER_COLUMN, user.numbers.get(0).number); values.put(TYPE_COLUMN, PUSH_TYPE); - mDatabase.insert(TABLE_NAME, null, values); + mDatabase.insertWithOnConflict(TABLE_NAME, null, values, SQLiteDatabase.CONFLICT_IGNORE); } Log.d(TAG, "finished populating push users."); }