]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/SendCommand.java
Update libsignal-service-java
[signal-cli] / src / main / java / org / asamk / signal / commands / SendCommand.java
index 1d0b46e4a5e8eabc08a5e80b131e347082fa5b0b..0c38cf7d59d9e60d73a1970da922fab5e1be990a 100644 (file)
@@ -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("--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.");
 
         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 {
     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.<String>getList("recipient");
         final var groupIdStrings = ns.<String>getList("group-id");
         final var isNoteToSelf = Boolean.TRUE.equals(ns.getBoolean("note-to-self"));
         final var recipientStrings = ns.<String>getList("recipient");
         final var groupIdStrings = ns.<String>getList("group-id");
@@ -236,7 +240,7 @@ public class SendCommand implements JsonRpcLocalCommand {
                     textStyles);
             var results = editTimestamp != null
                     ? m.sendEditMessage(message, recipientIdentifiers, editTimestamp)
                     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()
             outputResult(outputWriter, results);
         } catch (AttachmentInvalidException | IOException e) {
             throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()