From 86554a846440428fbb4965070956862c3e17c771 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 21 Oct 2016 21:59:07 +0200 Subject: retrigger key selection if openpgp key was deleted --- src/main/java/de/pixart/messenger/crypto/PgpEngine.java | 9 +++++++-- src/main/java/de/pixart/messenger/ui/XmppActivity.java | 9 ++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/main/java') 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); + } } }); } -- cgit v1.2.3