aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-10-19 11:53:55 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-10-19 11:53:55 +0200
commitdce8149aaec9b854853bc136eb6a9861885d4e8d (patch)
tree67d522143fcd3cd07bd2ae09f1a4049c09e2df03 /src/main/java
parent7226fc0010b4b35591930793c2e56174d5d4c193 (diff)
retrigger key selection if openpgp key was deleted
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/PgpEngine.java9
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppActivity.java9
2 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
index da315812..1a5367fd 100644
--- a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
+++ b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
@@ -259,8 +259,13 @@ public class PgpEngine {
account);
return;
case OpenPgpApi.RESULT_CODE_ERROR:
- logError(account, (OpenPgpError) result.getParcelableExtra(OpenPgpApi.RESULT_ERROR));
- callback.error(R.string.unable_to_connect_to_keychain, account);
+ OpenPgpError error = result.getParcelableExtra(OpenPgpApi.RESULT_ERROR);
+ if (error != null && "signing subkey not found!".equals(error.getMessage())) {
+ callback.error(0,account);
+ } else {
+ logError(account, error);
+ callback.error(R.string.unable_to_connect_to_keychain, null);
+ }
}
}
});
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
index 5172e18d..c2dfa1d8 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java
@@ -584,7 +584,14 @@ public abstract class XmppActivity extends Activity {
@Override
public void error(int error, Account account) {
- displayErrorDialog(error);
+ if (error == 0 && account != null) {
+ account.setPgpSignId(0);
+ account.unsetPgpSignature();
+ xmppConnectionService.databaseBackend.updateAccount(account);
+ choosePgpSignId(account);
+ } else {
+ displayErrorDialog(error);
+ }
}
});
}