Merge pull request #1655 from adithyaphilip/pgp-fix

Fixes having to choose PGP twice, upgrades openpgp-api to 10
This commit is contained in:
Daniel Gultsch 2016-01-16 21:35:38 +01:00
commit 0b239243d9
2 changed files with 5 additions and 2 deletions

View file

@ -29,7 +29,7 @@ repositories {
dependencies { dependencies {
compile project(':libs:MemorizingTrustManager') compile project(':libs:MemorizingTrustManager')
compile 'org.sufficientlysecure:openpgp-api:9.0' compile 'org.sufficientlysecure:openpgp-api:10.0'
compile 'com.soundcloud.android:android-crop:1.0.1@aar' compile 'com.soundcloud.android:android-crop:1.0.1@aar'
compile 'com.android.support:support-v13:23.0.1' compile 'com.android.support:support-v13:23.0.1'
compile 'org.bouncycastle:bcprov-jdk15on:1.52' compile 'org.bouncycastle:bcprov-jdk15on:1.52'

View file

@ -1270,9 +1270,12 @@ public class ConversationActivity extends XmppActivity
if (requestCode == REQUEST_DECRYPT_PGP) { if (requestCode == REQUEST_DECRYPT_PGP) {
mConversationFragment.onActivityResult(requestCode, resultCode, data); mConversationFragment.onActivityResult(requestCode, resultCode, data);
} else if (requestCode == REQUEST_CHOOSE_PGP_ID) { } else if (requestCode == REQUEST_CHOOSE_PGP_ID) {
// the user chose OpenPGP for encryption and selected his key in the PGP provider
if (xmppConnectionServiceBound) { if (xmppConnectionServiceBound) {
if (data.getExtras().containsKey(OpenPgpApi.EXTRA_SIGN_KEY_ID)) { 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)); 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); announcePgp(mSelectedConversation.getAccount(), null);
} else { } else {
choosePgpSignId(mSelectedConversation.getAccount()); choosePgpSignId(mSelectedConversation.getAccount());
@ -1283,7 +1286,7 @@ public class ConversationActivity extends XmppActivity
} }
} else if (requestCode == REQUEST_ANNOUNCE_PGP) { } else if (requestCode == REQUEST_ANNOUNCE_PGP) {
if (xmppConnectionServiceBound) { if (xmppConnectionServiceBound) {
announcePgp(mSelectedConversation.getAccount(), null); announcePgp(mSelectedConversation.getAccount(), mSelectedConversation);
this.mPostponedActivityResult = null; this.mPostponedActivityResult = null;
} else { } else {
this.mPostponedActivityResult = new Pair<>(requestCode, data); this.mPostponedActivityResult = new Pair<>(requestCode, data);