aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-21 21:59:07 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-21 21:59:07 +0200
commit86554a846440428fbb4965070956862c3e17c771 (patch)
treef727c4d97ea1392bf0dc0347673395bbceedbd75 /src/main/java/de
parent6827cc3d0cecb04fe029fcc2f6177715dc3338f6 (diff)
retrigger key selection if openpgp key was deleted
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/PgpEngine.java9
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java9
2 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/PgpEngine.java b/src/main/java/de/pixart/messenger/crypto/PgpEngine.java
index c77603219..38d097ec3 100644
--- a/src/main/java/de/pixart/messenger/crypto/PgpEngine.java
+++ b/src/main/java/de/pixart/messenger/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/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index fdaa49eb9..a279e4b6d 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -580,7 +580,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);
+ }
}
});
}