mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Use EMPTY send event listeners
This commit is contained in:
parent
891c05210e
commit
35622ac684
1 changed files with 3 additions and 27 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue