From cda1c2c3a12b4c18f13771dd4b58aab6e465176b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 7 Feb 2014 02:57:36 +0100 Subject: refresh contact list --- src/de/gultsch/chat/persistance/DatabaseBackend.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/de/gultsch/chat/persistance') diff --git a/src/de/gultsch/chat/persistance/DatabaseBackend.java b/src/de/gultsch/chat/persistance/DatabaseBackend.java index f28ad7606..ecf7152bf 100644 --- a/src/de/gultsch/chat/persistance/DatabaseBackend.java +++ b/src/de/gultsch/chat/persistance/DatabaseBackend.java @@ -53,7 +53,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { db.execSQL("create table " + Contact.TABLENAME + "(" + Contact.UUID + " TEXT PRIMARY KEY, " + Contact.ACCOUNT + " TEXT, " + Contact.DISPLAYNAME + " TEXT," + Contact.JID + " TEXT," - + Contact.LASTONLINEPRESENCE + " NUMBER, " + Contact.OPENPGPKEY + + Contact.LASTPRESENCE + " NUMBER, " + Contact.OPENPGPKEY + " TEXT," + Contact.PHOTOURI + " TEXT," + Contact.SUBSCRIPTION + " TEXT," + Contact.SYSTEMACCOUNT + " NUMBER, " + "FOREIGN KEY(" + Contact.ACCOUNT + ") REFERENCES " @@ -217,10 +217,11 @@ public class DatabaseBackend extends SQLiteOpenHelper { } } - public List getContacts() { + public List getContacts(Account account) { List list = new ArrayList(); SQLiteDatabase db = this.getReadableDatabase(); - Cursor cursor = db.query(Contact.TABLENAME, null, null, null, null, + String args[] = {account.getUuid()}; + Cursor cursor = db.query(Contact.TABLENAME, null, Contact.ACCOUNT+"=?", args, null, null, null); while (cursor.moveToNext()) { list.add(Contact.fromCursor(cursor)); -- cgit v1.2.3