From 35622ac6840defeecbbe382de3f9a0b81df72a1d Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 4 Sep 2021 13:26:52 +0200 Subject: [PATCH] Use EMPTY send event listeners --- .../signal/manager/helper/SendHelper.java | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java index dd07fc55..6ebc0254 100644 --- a/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java +++ b/lib/src/main/java/org/asamk/signal/manager/helper/SendHelper.java @@ -44,30 +44,6 @@ public class SendHelper { private final GroupProvider groupProvider; private final RecipientRegistrationRefresher recipientRegistrationRefresher; - private final SignalServiceMessageSender.IndividualSendEvents sendEvents = new SignalServiceMessageSender.IndividualSendEvents() { - @Override - public void onMessageEncrypted() { - } - - @Override - public void onMessageSent() { - } - - @Override - public void onSyncMessageSent() { - } - }; - - private final SignalServiceMessageSender.LegacyGroupEvents legacyGroupEvents = new SignalServiceMessageSender.LegacyGroupEvents() { - @Override - public void onMessageSent() { - } - - @Override - public void onSyncMessageSent() { - } - }; - public SendHelper( final SignalAccount account, final SignalDependencies dependencies, @@ -277,7 +253,7 @@ public class SendHelper { isRecipientUpdate, ContentHint.DEFAULT, message, - legacyGroupEvents, + SignalServiceMessageSender.LegacyGroupEvents.EMPTY, sendResult -> logger.trace("Partial message send result: {}", sendResult.isSuccess()), () -> false); } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) { @@ -297,14 +273,14 @@ public class SendHelper { unidentifiedAccessHelper.getAccessFor(recipientId), ContentHint.DEFAULT, message, - sendEvents); + SignalServiceMessageSender.IndividualSendEvents.EMPTY); } catch (UnregisteredUserException e) { final var newRecipientId = recipientRegistrationRefresher.refreshRecipientRegistration(recipientId); return messageSender.sendDataMessage(addressResolver.resolveSignalServiceAddress(newRecipientId), unidentifiedAccessHelper.getAccessFor(newRecipientId), ContentHint.DEFAULT, message, - sendEvents); + SignalServiceMessageSender.IndividualSendEvents.EMPTY); } } catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) { return SendMessageResult.identityFailure(address, e.getIdentityKey());