aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/persistance
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-09-28 15:21:56 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-09-28 15:21:56 +0200
commitbff23c2e232e8f9a4e64553215130079b7fc5a4f (patch)
treefec9608b615334ff065399b03fb747c4a7bf4d94 /src/eu/siacs/conversations/persistance
parent1ae9338fc9d5f8e1f6505445f07f4476efd8f139 (diff)
new notification service. first draft
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r--src/eu/siacs/conversations/persistance/DatabaseBackend.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
index 7afe387e..0231c0e7 100644
--- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -51,9 +51,9 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ Conversation.ACCOUNT + " TEXT, " + Conversation.CONTACTJID
+ " TEXT, " + Conversation.CREATED + " NUMBER, "
+ Conversation.STATUS + " NUMBER, " + Conversation.MODE
- + " NUMBER, "+Conversation.ATTRIBUTES + " TEXT, FOREIGN KEY(" + Conversation.ACCOUNT
- + ") REFERENCES " + Account.TABLENAME + "(" + Account.UUID
- + ") ON DELETE CASCADE);");
+ + " NUMBER, " + Conversation.ATTRIBUTES + " TEXT, FOREIGN KEY("
+ + Conversation.ACCOUNT + ") REFERENCES " + Account.TABLENAME
+ + "(" + Account.UUID + ") ON DELETE CASCADE);");
db.execSQL("create table " + Message.TABLENAME + "( " + Message.UUID
+ " TEXT PRIMARY KEY, " + Message.CONVERSATION + " TEXT, "
+ Message.TIME_SENT + " NUMBER, " + Message.COUNTERPART
@@ -225,13 +225,14 @@ public class DatabaseBackend extends SQLiteOpenHelper {
String[] args = { account.getUuid() };
db.delete(Account.TABLENAME, Account.UUID + "=?", args);
}
-
+
public boolean hasEnabledAccounts() {
SQLiteDatabase db = this.getReadableDatabase();
- Cursor cursor= db.rawQuery("select count("+Account.UUID+") from "+Account.TABLENAME+" where not options & (1 <<1)", null);
+ Cursor cursor = db.rawQuery("select count(" + Account.UUID + ") from "
+ + Account.TABLENAME + " where not options & (1 <<1)", null);
cursor.moveToFirst();
int count = cursor.getInt(0);
- return (count>0);
+ return (count > 0);
}
@Override