aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-08-01 13:33:24 +0200
committerChristian Schneppe <christian@pix-art.de>2017-08-01 13:33:24 +0200
commit0e5e5cbbf707cc01c110b478eef79266a58c0a70 (patch)
treeca0752ef96502b78bb53220f72880cefd961d12e /src/main/java/de/pixart/messenger/ui/ConversationFragment.java
parent9e51cf8a85eeb143d041bf7e2d20212a456e5a8f (diff)
Give up PGP decryption when intent is cancelled
When receiving a PGP message which is not encrypted with YOUR key, OpenKeychain shows a dialog, which tells you the private key to decrypt the message is unavailable. However, Conversations won't give up decrypting the message. So whether the subsequent messages are decryptable or not, the decryption is blocked at the current message. The commit fixes the bug in this way: Give up the current message when the decryption intent is cancelled, so that subsequent messages can be handled.
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConversationFragment.java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index a243688d7..30d0f19ff 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -1640,6 +1640,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
int choice = data.getIntExtra("choice", ConversationActivity.ATTACHMENT_CHOICE_INVALID);
activity.selectPresenceToAttachFile(choice, conversation.getNextEncryption());
}
+ } else if (resultCode == Activity.RESULT_CANCELED) {
+ if (requestCode == ConversationActivity.REQUEST_DECRYPT_PGP) {
+ // discard the message to prevent decryption being blocked
+ conversation.getAccount().getPgpDecryptionService().giveUpCurrentDecryption();
+ }
}
}