aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/persistance
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-10 03:34:00 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-10 03:34:00 +0100
commit2d0c0e6a4081955b68669c82071a5099e2e1a96e (patch)
tree229879dfa6611547331849952b220f5fd4b82d54 /src/de/gultsch/chat/persistance
parentc6440aab12460490ef8e9167eac0b515e04f1cdf (diff)
contact badges
Diffstat (limited to 'src/de/gultsch/chat/persistance')
-rw-r--r--src/de/gultsch/chat/persistance/DatabaseBackend.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/de/gultsch/chat/persistance/DatabaseBackend.java b/src/de/gultsch/chat/persistance/DatabaseBackend.java
index fe2031379..58f052ecc 100644
--- a/src/de/gultsch/chat/persistance/DatabaseBackend.java
+++ b/src/de/gultsch/chat/persistance/DatabaseBackend.java
@@ -233,9 +233,15 @@ public class DatabaseBackend extends SQLiteOpenHelper {
public List<Contact> getContacts(Account account) {
List<Contact> list = new ArrayList<Contact>();
SQLiteDatabase db = this.getReadableDatabase();
- String args[] = {account.getUuid()};
- Cursor cursor = db.query(Contact.TABLENAME, null, Contact.ACCOUNT+"=?", args, null,
- null, null);
+ Cursor cursor;
+ if (account==null) {
+ cursor = db.query(Contact.TABLENAME, null, null, null, null,
+ null, null);
+ } else {
+ String args[] = {account.getUuid()};
+ cursor = db.query(Contact.TABLENAME, null, Contact.ACCOUNT+"=?", args, null,
+ null, null);
+ }
while (cursor.moveToNext()) {
list.add(Contact.fromCursor(cursor));
}