From a9a3ef0f6783a235575740553daffb0d8d4c586b Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Sat, 16 Jan 2016 03:24:29 +0530 Subject: fixed PGP having to be selected twice --- src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs/conversations') diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 2f6ebe33c..e5fbee438 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -1270,9 +1270,12 @@ public class ConversationActivity extends XmppActivity if (requestCode == REQUEST_DECRYPT_PGP) { mConversationFragment.onActivityResult(requestCode, resultCode, data); } else if (requestCode == REQUEST_CHOOSE_PGP_ID) { + // the user chose OpenPGP for encryption and selected his key in the PGP provider if (xmppConnectionServiceBound) { if (data.getExtras().containsKey(OpenPgpApi.EXTRA_SIGN_KEY_ID)) { + // associate selected PGP keyId with the account mSelectedConversation.getAccount().setPgpSignId(data.getExtras().getLong(OpenPgpApi.EXTRA_SIGN_KEY_ID)); + // we need to announce the key as described in XEP-027 announcePgp(mSelectedConversation.getAccount(), null); } else { choosePgpSignId(mSelectedConversation.getAccount()); @@ -1283,7 +1286,7 @@ public class ConversationActivity extends XmppActivity } } else if (requestCode == REQUEST_ANNOUNCE_PGP) { if (xmppConnectionServiceBound) { - announcePgp(mSelectedConversation.getAccount(), null); + announcePgp(mSelectedConversation.getAccount(), mSelectedConversation); this.mPostponedActivityResult = null; } else { this.mPostponedActivityResult = new Pair<>(requestCode, data); -- cgit v1.2.3