aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/persistance/DatabaseBackend.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-07 02:57:36 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-07 02:57:36 +0100
commitcda1c2c3a12b4c18f13771dd4b58aab6e465176b (patch)
tree9f246adce16c0951f64f4233c4c0ad8d00d7c8e1 /src/de/gultsch/chat/persistance/DatabaseBackend.java
parentaa42eb544a1ebf99dc52d71c917b899d1fce628d (diff)
refresh contact list
Diffstat (limited to 'src/de/gultsch/chat/persistance/DatabaseBackend.java')
-rw-r--r--src/de/gultsch/chat/persistance/DatabaseBackend.java7
1 files changed, 4 insertions, 3 deletions
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<Contact> getContacts() {
+ public List<Contact> getContacts(Account account) {
List<Contact> list = new ArrayList<Contact>();
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));