diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 15:35:51 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 15:35:51 +0100 |
commit | 196c8e593fa8f98027048d9e097507c108f1410e (patch) | |
tree | 76b76a9025eb4747f0711a17945b285fafe2efb8 /src/main/java/eu/siacs/conversations/entities/Account.java | |
parent | 0664d6ac7b8d0cefac8fa92df625fe653d606b1a (diff) | |
parent | e5f154316cbfa1d701947fae8bc31239df37531a (diff) |
Merge pull request #1595 from fiaxh/pgp_database_signature
Regenerate PGP signatures once
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Account.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Account.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index 75e6b2a00..64bbaa2b0 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -413,13 +413,13 @@ public class Account extends AbstractEntity { } public String getPgpSignature() { - if (keys.has(KEY_PGP_SIGNATURE)) { - try { + try { + if (keys.has(KEY_PGP_SIGNATURE) && !"null".equals(keys.getString(KEY_PGP_SIGNATURE))) { return keys.getString(KEY_PGP_SIGNATURE); - } catch (final JSONException e) { + } else { return null; } - } else { + } catch (final JSONException e) { return null; } } @@ -433,6 +433,15 @@ public class Account extends AbstractEntity { return true; } + public boolean unsetPgpSignature() { + try { + keys.put(KEY_PGP_SIGNATURE, JSONObject.NULL); + } catch (JSONException e) { + return false; + } + return true; + } + public long getPgpId() { if (keys.has(KEY_PGP_ID)) { try { |