Merge pull request #1011 from k9mail/fix-openpgp-decrypt-loop-864

Fix OpenPGP decrypt loop
This commit is contained in:
cketti 2016-01-13 08:32:44 +01:00
commit 733f7f63f1

View file

@ -63,6 +63,7 @@ public class MessageCryptoHelper {
private Intent currentCryptoResult;
private MessageCryptoAnnotations messageAnnotations;
private Intent userInteractionResultIntent;
public MessageCryptoHelper(Activity activity, Account account, MessageCryptoCallback callback) {
@ -163,7 +164,12 @@ public class MessageCryptoHelper {
private void decryptOrVerifyPart(CryptoPart cryptoPart) {
currentCryptoPart = cryptoPart;
decryptVerify(new Intent());
Intent decryptIntent = userInteractionResultIntent;
userInteractionResultIntent = null;
if (decryptIntent == null) {
decryptIntent = new Intent();
}
decryptVerify(decryptIntent);
}
private void decryptVerify(Intent intent) {
@ -419,6 +425,7 @@ public class MessageCryptoHelper {
}
if (resultCode == Activity.RESULT_OK) {
userInteractionResultIntent = data;
decryptOrVerifyNextPart();
} else {
onCryptoFailed(new OpenPgpError(OpenPgpError.CLIENT_SIDE_ERROR, context.getString(R.string.openpgp_canceled_by_user)));