From 9fd2c6f9ec1a9884977d40b779fdfa787a357f75 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sun, 12 Jul 2020 15:47:06 +0200 Subject: [PATCH] OX-IM: Remove redundant code to add self to recipients --- .../smackx/ox_im/OXInstantMessagingManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java index 4383a02b3..c9fc021eb 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java @@ -264,7 +264,7 @@ public final class OXInstantMessagingManager extends Manager { * Add an OX-IM message element to a message. * * @param messageBuilder message - * @param contacts recipients of the message + * @param recipients recipients of the message * @param payload payload which will be encrypted and signed * * @return metadata about the messages encryption + signatures. @@ -273,13 +273,9 @@ public final class OXInstantMessagingManager extends Manager { * @throws PGPException in case something goes wrong during encryption * @throws IOException IO is dangerous (we need to read keys) */ - public OpenPgpMetadata addOxMessage(MessageBuilder messageBuilder, Set contacts, List payload) + public OpenPgpMetadata addOxMessage(MessageBuilder messageBuilder, Set recipients, List payload) throws SmackException.NotLoggedInException, IOException, PGPException { - HashSet recipients = new HashSet<>(contacts); - OpenPgpContact self = openPgpManager.getOpenPgpSelf(); - recipients.add(self); - OpenPgpElementAndMetadata openPgpElementAndMetadata = signAndEncrypt(recipients, payload); messageBuilder.addExtension(openPgpElementAndMetadata.getElement());