Fix returned autocrypt state in OpenPgpServiceKeyIdExtractor

This commit is contained in:
Vincent Breitmoser 2018-11-21 16:28:33 +01:00
parent 1f33102d7b
commit 29b014edad
1 changed files with 7 additions and 3 deletions

View File

@ -108,7 +108,7 @@ class OpenPgpServiceKeyIdExtractor {
HashSet<Long> keyIds = new HashSet<>();
ArrayList<String> missingEmails = new ArrayList<>();
ArrayList<String> duplicateEmails = new ArrayList<>();
int combinedAutocryptState = AutocryptStatus.AUTOCRYPT_PEER_DISABLED;
Integer combinedAutocryptState = null;
if (hasAddresses) {
HashMap<String, AddressQueryResult> userIdEntries = getStatusMapForQueriedAddresses(
@ -128,8 +128,12 @@ class OpenPgpServiceKeyIdExtractor {
anyKeyNotVerified = true;
}
combinedAutocryptState = combineAutocryptState(
combinedAutocryptState, addressQueryResult.autocryptState);
if (combinedAutocryptState == null) {
combinedAutocryptState = addressQueryResult.autocryptState;
} else {
combinedAutocryptState = combineAutocryptState(
combinedAutocryptState, addressQueryResult.autocryptState);
}
continue;
}