diff options
author | fiaxh <github@lightrise.org> | 2015-12-02 15:43:55 +0000 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-12-04 20:16:07 +0100 |
commit | 5bcf397efb7f4201e23bbdab536237a1ee65b584 (patch) | |
tree | fef157717d2503edb11c08d07a64a1009195cd94 /src/main/java/eu/siacs/conversations/persistance | |
parent | 6ff6887d2b67550362a635c5717f8c4b27d72a88 (diff) |
Unset all PGP signatures once
... so they will be redone to match the changed status.
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 8b74581cc..2347c3188 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -43,7 +43,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { private static DatabaseBackend instance = null; private static final String DATABASE_NAME = "history"; - private static final int DATABASE_VERSION = 20; + private static final int DATABASE_VERSION = 21; private static String CREATE_CONTATCS_STATEMENT = "create table " + Contact.TABLENAME + "(" + Contact.ACCOUNT + " TEXT, " @@ -335,6 +335,15 @@ public class DatabaseBackend extends SQLiteOpenHelper { if (oldVersion < 18 && newVersion >= 18) { db.execSQL("ALTER TABLE " + Message.TABLENAME + " ADD COLUMN " + Message.READ + " NUMBER DEFAULT 1"); } + + if (oldVersion < 21 && newVersion >= 21) { + List<Account> accounts = getAccounts(db); + for (Account account : accounts) { + account.unsetPgpSignature(); + db.update(Account.TABLENAME, account.getContentValues(), Account.UUID + + "=?", new String[]{account.getUuid()}); + } + } } public static synchronized DatabaseBackend getInstance(Context context) { |