X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/caa4fa0180a84cca10a1b363d25147d03ccb0387..3290a5bf4d642beaef6584a700aab8f2da3af6e0:/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java diff --git a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java index 6e394eb4..5ad14537 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java @@ -225,19 +225,20 @@ public class DbusSignalImpl implements Signal, AutoCloseable { } @Override - public long sendMessage(final String message, final List attachments, final List recipients) { + public long sendMessage(final String messageText, final List attachments, final List recipients) { try { - final var results = m.sendMessage(new Message(message, - attachments, - List.of(), - Optional.empty(), - Optional.empty(), - List.of(), - Optional.empty(), - List.of()), - getSingleRecipientIdentifiers(recipients, m.getSelfNumber()).stream() - .map(RecipientIdentifier.class::cast) - .collect(Collectors.toSet())); + final var message = new Message(messageText, + attachments, + List.of(), + Optional.empty(), + Optional.empty(), + List.of(), + Optional.empty(), + List.of()); + final var recipientIdentifiers = getSingleRecipientIdentifiers(recipients, m.getSelfNumber()).stream() + .map(RecipientIdentifier.class::cast) + .collect(Collectors.toSet()); + final var results = m.sendMessage(message, recipientIdentifiers, false); checkSendMessageResults(results); return results.timestamp(); @@ -384,17 +385,18 @@ public class DbusSignalImpl implements Signal, AutoCloseable { @Override public long sendNoteToSelfMessage( - final String message, final List attachments + final String messageText, final List attachments ) throws Error.AttachmentInvalid, Error.Failure, Error.UntrustedIdentity { try { - final var results = m.sendMessage(new Message(message, + final var message = new Message(messageText, attachments, List.of(), Optional.empty(), Optional.empty(), List.of(), Optional.empty(), - List.of()), Set.of(RecipientIdentifier.NoteToSelf.INSTANCE)); + List.of()); + final var results = m.sendMessage(message, Set.of(RecipientIdentifier.NoteToSelf.INSTANCE), false); checkSendMessageResults(results); return results.timestamp(); } catch (AttachmentInvalidException e) { @@ -429,16 +431,17 @@ public class DbusSignalImpl implements Signal, AutoCloseable { } @Override - public long sendGroupMessage(final String message, final List attachments, final byte[] groupId) { + public long sendGroupMessage(final String messageText, final List attachments, final byte[] groupId) { try { - var results = m.sendMessage(new Message(message, + final var message = new Message(messageText, attachments, List.of(), Optional.empty(), Optional.empty(), List.of(), Optional.empty(), - List.of()), Set.of(getGroupRecipientIdentifier(groupId))); + List.of()); + var results = m.sendMessage(message, Set.of(getGroupRecipientIdentifier(groupId)), false); checkSendMessageResults(results); return results.timestamp(); } catch (IOException | InvalidStickerException e) {