diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 14:10:52 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-09 14:10:52 +0100 |
commit | c6440aab12460490ef8e9167eac0b515e04f1cdf (patch) | |
tree | 28c4a760cb3d0edc187bd574466455f531034caf /src/de/gultsch/chat/persistance/DatabaseBackend.java | |
parent | 892f565a30446b972586952abd27ac455cf3ca99 (diff) |
carbons
Diffstat (limited to '')
-rw-r--r-- | src/de/gultsch/chat/persistance/DatabaseBackend.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/de/gultsch/chat/persistance/DatabaseBackend.java b/src/de/gultsch/chat/persistance/DatabaseBackend.java index 135296a6..fe203137 100644 --- a/src/de/gultsch/chat/persistance/DatabaseBackend.java +++ b/src/de/gultsch/chat/persistance/DatabaseBackend.java @@ -8,6 +8,7 @@ import de.gultsch.chat.entities.Account; import de.gultsch.chat.entities.Contact; import de.gultsch.chat.entities.Conversation; import de.gultsch.chat.entities.Message; +import de.gultsch.chat.entities.Presences; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; @@ -214,12 +215,13 @@ public class DatabaseBackend extends SQLiteOpenHelper { SQLiteDatabase db = this.getWritableDatabase(); for (int i = 0; i < contacts.size(); i++) { Contact contact = contacts.get(i); - String[] columns = {Contact.UUID}; + String[] columns = {Contact.UUID, Contact.PRESENCES}; String[] args = {contact.getAccount().getUuid(), contact.getJid()}; Cursor cursor = db.query(Contact.TABLENAME, columns,Contact.ACCOUNT+"=? AND "+Contact.JID+"=?", args, null, null, null); if (cursor.getCount()>=1) { cursor.moveToFirst(); contact.setUuid(cursor.getString(0)); + contact.setPresences(Presences.fromJsonString(cursor.getString(1))); updateContact(contact); } else { contact.setUuid(UUID.randomUUID().toString()); |