aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/persistance
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-09-07 14:34:58 +0200
committerChristian Schneppe <christian@pix-art.de>2016-09-08 22:54:18 +0200
commit8adf715f7cd259c1b27a6125720e88b2e765863f (patch)
treeb7968ab440050631aa4949c7b3d4dc084e7ecf12 /src/main/java/de/pixart/messenger/persistance
parent299e4bb9ff1994fedd37cb16667f04c1bca50fd4 (diff)
be a bit more careful when deleting and deactivating accounts
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
index 256720be5..99ff1a5fb 100644
--- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java
@@ -607,17 +607,18 @@ public class DatabaseBackend extends SQLiteOpenHelper {
return list;
}
- public void updateAccount(Account account) {
+ public boolean updateAccount(Account account) {
SQLiteDatabase db = this.getWritableDatabase();
String[] args = {account.getUuid()};
- db.update(Account.TABLENAME, account.getContentValues(), Account.UUID
- + "=?", args);
+ final int rows = db.update(Account.TABLENAME, account.getContentValues(), Account.UUID + "=?", args);
+ return rows == 1;
}
- public void deleteAccount(Account account) {
+ public boolean deleteAccount(Account account) {
SQLiteDatabase db = this.getWritableDatabase();
String[] args = {account.getUuid()};
- db.delete(Account.TABLENAME, Account.UUID + "=?", args);
+ final int rows = db.delete(Account.TABLENAME, Account.UUID + "=?", args);
+ return rows == 1;
}
public boolean hasEnabledAccounts() {