diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-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 { |