aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/persistance/DatabaseBackend.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/persistance/DatabaseBackend.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
index 852a9315..68fc56cd 100644
--- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -201,9 +201,13 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ "=?", args);
}
- public void updateContact(Contact contact) {
+ public void updateContact(Contact contact, boolean updatePresences) {
SQLiteDatabase db = this.getWritableDatabase();
String[] args = { contact.getUuid() };
+ ContentValues values = contact.getContentValues();
+ if (!updatePresences) {
+ values.remove(Contact.PRESENCES);
+ }
db.update(Contact.TABLENAME, contact.getContentValues(), Contact.UUID
+ "=?", args);
}
@@ -227,8 +231,8 @@ public class DatabaseBackend extends SQLiteOpenHelper {
if (cursor.getCount()>=1) {
cursor.moveToFirst();
contact.setUuid(cursor.getString(0));
- contact.setPresences(Presences.fromJsonString(cursor.getString(1)));
- updateContact(contact);
+ //contact.setPresences(Presences.fromJsonString(cursor.getString(1)));
+ updateContact(contact,false);
} else {
contact.setUuid(UUID.randomUUID().toString());
createContact(contact);