diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-17 14:18:42 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-03-17 14:18:42 +0100 |
commit | 5e4239a7b98a050b4312eee075f2fdac7f2b8af2 (patch) | |
tree | 217082968f41a68c6635f9bed26e02f561cc41de | |
parent | e8ad4317a49cc86ddd5e147fe18f82beb02f9717 (diff) | |
parent | 87004fd0ca3a5178fba3050599a445ba9c64662c (diff) | |
download | open-keychain-5e4239a7b98a050b4312eee075f2fdac7f2b8af2.tar.gz open-keychain-5e4239a7b98a050b4312eee075f2fdac7f2b8af2.tar.bz2 open-keychain-5e4239a7b98a050b4312eee075f2fdac7f2b8af2.zip |
Merge branch 'certify' into certs
Conflicts:
OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java
OpenPGP-Keychain/src/main/res/values/strings.xml
2 files changed, 10 insertions, 2 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index 5e7eb0a4a..40a0b72ce 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -432,7 +432,7 @@ public class PgpKeyOperation { // TODO: this only takes care of user id certificates, what about others? PGPPublicKey pubkey = publicKeyRing.getPublicKey(); for(String uid : new IterableIterator<String>(pubkey.getUserIDs())) { - for(PGPSignature sig : new IterableIterator<PGPSignature>(oldPublicKey.getSignaturesForID(uid))) { + for(PGPSignature sig : new IterableIterator<PGPSignature>(oldPublicKey.getSignaturesForID(uid), true)) { // but skip self certificates if(sig.getKeyID() == pubkey.getKeyID()) continue; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/IterableIterator.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/IterableIterator.java index caaa07524..40105df4f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/IterableIterator.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/IterableIterator.java @@ -16,13 +16,21 @@ package org.sufficientlysecure.keychain.util; +import java.util.ArrayList; import java.util.Iterator; public class IterableIterator<T> implements Iterable<T> { private Iterator<T> mIter; - public IterableIterator(Iterator<T> iter) { + public IterableIterator(Iterator<T> iter, boolean failsafe) { mIter = iter; + if(failsafe && mIter == null) { + // is there a better way? + mIter = new ArrayList<T>().iterator(); + } + } + public IterableIterator(Iterator<T> iter) { + this(iter, false); } public Iterator<T> iterator() { |