X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/c07ba14fc6936e638d7fa6eb5c758bdaa7219747..3290a5bf4d642beaef6584a700aab8f2da3af6e0:/src/main/java/org/asamk/signal/commands/SendCommand.java diff --git a/src/main/java/org/asamk/signal/commands/SendCommand.java b/src/main/java/org/asamk/signal/commands/SendCommand.java index 1d0b46e4..0c38cf7d 100644 --- a/src/main/java/org/asamk/signal/commands/SendCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendCommand.java @@ -51,6 +51,9 @@ public class SendCommand implements JsonRpcLocalCommand { subparser.addArgument("--note-to-self") .help("Send the message to self without notification.") .action(Arguments.storeTrue()); + subparser.addArgument("--notify-self") + .help("If self is part of recipients/groups send a normal message, not a sync message.") + .action(Arguments.storeTrue()); var mut = subparser.addMutuallyExclusiveGroup(); mut.addArgument("-m", "--message").help("Specify the message to be sent."); @@ -105,6 +108,7 @@ public class SendCommand implements JsonRpcLocalCommand { public void handleCommand( final Namespace ns, final Manager m, final OutputWriter outputWriter ) throws CommandException { + final var notifySelf = Boolean.TRUE.equals(ns.getBoolean("notify-self")); final var isNoteToSelf = Boolean.TRUE.equals(ns.getBoolean("note-to-self")); final var recipientStrings = ns.getList("recipient"); final var groupIdStrings = ns.getList("group-id"); @@ -236,7 +240,7 @@ public class SendCommand implements JsonRpcLocalCommand { textStyles); var results = editTimestamp != null ? m.sendEditMessage(message, recipientIdentifiers, editTimestamp) - : m.sendMessage(message, recipientIdentifiers); + : m.sendMessage(message, recipientIdentifiers, notifySelf); outputResult(outputWriter, results); } catch (AttachmentInvalidException | IOException e) { throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()