mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-25 15:52:06 +01:00
[openpgp] Improve control-flow logic in PainlessOpenPgpProvider
Also remove superfluous toString().
This commit is contained in:
parent
64db6e3ebc
commit
5e43ef550f
1 changed files with 5 additions and 4 deletions
|
@ -71,11 +71,12 @@ public class PainlessOpenPgpProvider implements OpenPgpProvider {
|
||||||
ArrayList<PGPPublicKeyRingCollection> recipientKeys = new ArrayList<>();
|
ArrayList<PGPPublicKeyRingCollection> recipientKeys = new ArrayList<>();
|
||||||
for (OpenPgpContact contact : recipients) {
|
for (OpenPgpContact contact : recipients) {
|
||||||
PGPPublicKeyRingCollection keys = contact.getTrustedAnnouncedKeys();
|
PGPPublicKeyRingCollection keys = contact.getTrustedAnnouncedKeys();
|
||||||
if (keys != null) {
|
if (keys == null) {
|
||||||
recipientKeys.add(keys);
|
LOGGER.log(Level.WARNING, "There are no suitable keys for contact " + contact.getJid());
|
||||||
} else {
|
|
||||||
LOGGER.log(Level.WARNING, "There are no suitable keys for contact " + contact.getJid().toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recipientKeys.add(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
EncryptionStream cipherStream = PGPainless.createEncryptor().onOutputStream(cipherText)
|
EncryptionStream cipherStream = PGPainless.createEncryptor().onOutputStream(cipherText)
|
||||||
|
|
Loading…
Reference in a new issue