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
This commit is contained in:
Vincent Breitmoser 2014-03-17 14:18:42 +01:00
commit 5e4239a7b9
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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() {