diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-19 01:35:23 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-19 01:35:23 +0100 |
commit | 746f9591553a5373e8ce1211ed066cbbf6a31cb5 (patch) | |
tree | f4832ba070106fc7e892c8a6ee1272233d4463ab /src/de/gultsch/chat/persistance/DatabaseBackend.java | |
parent | 0392e6b2dc4c9bc4063fce5c1b4817c3c6460426 (diff) |
roster versioning. roster updates on air. performance fixes in conversation listview
Diffstat (limited to 'src/de/gultsch/chat/persistance/DatabaseBackend.java')
-rw-r--r-- | src/de/gultsch/chat/persistance/DatabaseBackend.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/de/gultsch/chat/persistance/DatabaseBackend.java b/src/de/gultsch/chat/persistance/DatabaseBackend.java index 4607883c..caee4e8f 100644 --- a/src/de/gultsch/chat/persistance/DatabaseBackend.java +++ b/src/de/gultsch/chat/persistance/DatabaseBackend.java @@ -245,6 +245,16 @@ public class DatabaseBackend extends SQLiteOpenHelper { } return list; } + + public List<Contact> getContats(String where) { + List<Contact> list = new ArrayList<Contact>(); + SQLiteDatabase db = this.getReadableDatabase(); + Cursor cursor = db.query(Contact.TABLENAME, null, where, null, null, null, null); + while (cursor.moveToNext()) { + list.add(Contact.fromCursor(cursor)); + } + return list; + } public Contact findContact(Account account, String jid) { SQLiteDatabase db = this.getReadableDatabase(); @@ -263,4 +273,12 @@ public class DatabaseBackend extends SQLiteOpenHelper { String[] args = { message.getUuid() }; db.delete(Message.TABLENAME, Message.UUID + "=?", args); } + + public void deleteContact(Contact contact) { + SQLiteDatabase db = this.getWritableDatabase(); + String[] args = { contact.getUuid() }; + db.delete(Contact.TABLENAME, Contact.UUID + "=?", args); + } + + } |