diff options
Diffstat (limited to 'src/de/gultsch/chat/persistance')
-rw-r--r-- | src/de/gultsch/chat/persistance/DatabaseBackend.java | 18 | ||||
-rw-r--r-- | src/de/gultsch/chat/persistance/OnPhoneContactsMerged.java | 5 |
2 files changed, 23 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); + } + + } diff --git a/src/de/gultsch/chat/persistance/OnPhoneContactsMerged.java b/src/de/gultsch/chat/persistance/OnPhoneContactsMerged.java new file mode 100644 index 00000000..a7918efb --- /dev/null +++ b/src/de/gultsch/chat/persistance/OnPhoneContactsMerged.java @@ -0,0 +1,5 @@ +package de.gultsch.chat.persistance; + +public interface OnPhoneContactsMerged { + public void phoneContactsMerged(); +} |