From: AsamK Date: Tue, 10 Aug 2021 12:33:51 +0000 (+0200) Subject: Replace --group parameter with --group-id X-Git-Tag: v0.9.0~86 X-Git-Url: https://git.nmode.ca/signal-cli/commitdiff_plain/6c000544072fb0be012dafeea5761fa9e0744ee4?ds=inline Replace --group parameter with --group-id --- diff --git a/man/signal-cli.1.adoc b/man/signal-cli.1.adoc index 690e33b7..0e3789e5 100644 --- a/man/signal-cli.1.adoc +++ b/man/signal-cli.1.adoc @@ -162,7 +162,7 @@ Send a message to another user or group. RECIPIENT:: Specify the recipients’ phone number. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. *-m* MESSAGE, *--message* MESSAGE:: @@ -184,7 +184,7 @@ Send reaction to a previously received or sent message. RECIPIENT:: Specify the recipients’ phone number. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. *-e* EMOJI, *--emoji* EMOJI:: @@ -207,7 +207,7 @@ Indicator will be shown for 15seconds unless a typing STOP message is sent first RECIPIENT:: Specify the recipients’ phone number. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. *-s*, *--stop*:: @@ -220,7 +220,7 @@ Remotely delete a previously sent message. RECIPIENT:: Specify the recipients’ phone number. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP:: @@ -250,7 +250,7 @@ The invitation link URI (starts with `https://signal.group/#`) Create or update a group. If the user is a pending member, this command will accept the group invitation. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. If not specified, a new group with a new random ID is generated. @@ -296,7 +296,7 @@ To disable expiration set expiration time to 0. Send a quit group message to all group members and remove self from member list. If the user is a pending member, this command will decline the group invitation. -*-g* GROUP, *--group* GROUP:: +*-g* GROUP, *--group-id* GROUP:: Specify the recipient group ID in base64 encoding. *--delete*:: @@ -385,7 +385,7 @@ This change is only local but can be synchronized to other devices by using `sen [CONTACT [CONTACT ...]]:: Specify the phone numbers of contacts that should be blocked. -*-g* [GROUP [GROUP ...]], *--group* [GROUP [GROUP ...]]:: +*-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]:: Specify the group IDs that should be blocked in base64 encoding. === unblock @@ -396,7 +396,7 @@ This change is only local but can be synchronized to other devices by using `sen [CONTACT [CONTACT ...]]:: Specify the phone numbers of contacts that should be unblocked. -*-g* [GROUP [GROUP ...]], *--group* [GROUP [GROUP ...]]:: +*-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]:: Specify the group IDs that should be unblocked in base64 encoding. === sendContacts diff --git a/src/main/java/org/asamk/signal/commands/BlockCommand.java b/src/main/java/org/asamk/signal/commands/BlockCommand.java index e62bb79a..29a1f3e5 100644 --- a/src/main/java/org/asamk/signal/commands/BlockCommand.java +++ b/src/main/java/org/asamk/signal/commands/BlockCommand.java @@ -22,7 +22,7 @@ public class BlockCommand implements LocalCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help("Block the given contacts or groups (no messages will be received)"); subparser.addArgument("contact").help("Contact number").nargs("*"); - subparser.addArgument("-g", "--group").help("Group ID").nargs("*"); + subparser.addArgument("-g", "--group-id", "--group").help("Group ID").nargs("*"); } public BlockCommand(final OutputWriter outputWriter) { @@ -40,8 +40,8 @@ public class BlockCommand implements LocalCommand { } } - if (ns.getList("group") != null) { - for (var groupIdString : ns.getList("group")) { + if (ns.getList("group-id") != null) { + for (var groupIdString : ns.getList("group-id")) { try { var groupId = Util.decodeGroupId(groupIdString); m.setGroupBlocked(groupId, true); diff --git a/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java b/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java index ee64bac5..cb98e15a 100644 --- a/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java +++ b/src/main/java/org/asamk/signal/commands/QuitGroupCommand.java @@ -37,7 +37,7 @@ public class QuitGroupCommand implements LocalCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help("Send a quit group message to all group members and remove self from member list."); - subparser.addArgument("-g", "--group").required(true).help("Specify the recipient group ID."); + subparser.addArgument("-g", "--group-id", "--group").required(true).help("Specify the recipient group ID."); subparser.addArgument("--delete") .action(Arguments.storeTrue()) .help("Delete local group data completely after quitting group."); @@ -52,7 +52,7 @@ public class QuitGroupCommand implements LocalCommand { final GroupId groupId; try { - groupId = Util.decodeGroupId(ns.getString("group")); + groupId = Util.decodeGroupId(ns.getString("group-id")); } catch (GroupIdFormatException e) { throw new UserErrorException("Invalid group id: " + e.getMessage()); } diff --git a/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java b/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java index acd91227..f1af3ae1 100644 --- a/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java +++ b/src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java @@ -30,14 +30,14 @@ public class RemoteDeleteCommand implements DbusCommand { .required(true) .type(long.class) .help("Specify the timestamp of the message to delete."); - subparser.addArgument("-g", "--group").help("Specify the recipient group ID."); + subparser.addArgument("-g", "--group-id", "--group").help("Specify the recipient group ID."); subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*"); } @Override public void handleCommand(final Namespace ns, final Signal signal) throws CommandException { final List recipients = ns.getList("recipient"); - final var groupIdString = ns.getString("group"); + final var groupIdString = ns.getString("group-id"); final var noRecipients = recipients == null || recipients.isEmpty(); if (noRecipients && groupIdString == null) { diff --git a/src/main/java/org/asamk/signal/commands/SendCommand.java b/src/main/java/org/asamk/signal/commands/SendCommand.java index ae64fa9b..59ee6915 100644 --- a/src/main/java/org/asamk/signal/commands/SendCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendCommand.java @@ -36,7 +36,7 @@ public class SendCommand implements DbusCommand { subparser.help("Send a message to another user or group."); subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*"); final var mutuallyExclusiveGroup = subparser.addMutuallyExclusiveGroup(); - mutuallyExclusiveGroup.addArgument("-g", "--group").help("Specify the recipient group ID."); + mutuallyExclusiveGroup.addArgument("-g", "--group-id", "--group").help("Specify the recipient group ID."); mutuallyExclusiveGroup.addArgument("--note-to-self") .help("Send the message to self without notification.") .action(Arguments.storeTrue()); @@ -52,7 +52,7 @@ public class SendCommand implements DbusCommand { public void handleCommand(final Namespace ns, final Signal signal) throws CommandException { final List recipients = ns.getList("recipient"); final var isEndSession = ns.getBoolean("end-session"); - final var groupIdString = ns.getString("group"); + final var groupIdString = ns.getString("group-id"); final var isNoteToSelf = ns.getBoolean("note-to-self"); final var noRecipients = recipients == null || recipients.isEmpty(); diff --git a/src/main/java/org/asamk/signal/commands/SendReactionCommand.java b/src/main/java/org/asamk/signal/commands/SendReactionCommand.java index f77a2c4b..f3385ce3 100644 --- a/src/main/java/org/asamk/signal/commands/SendReactionCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendReactionCommand.java @@ -27,7 +27,7 @@ public class SendReactionCommand implements DbusCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help("Send reaction to a previously received or sent message."); - subparser.addArgument("-g", "--group").help("Specify the recipient group ID."); + subparser.addArgument("-g", "--group-id", "--group").help("Specify the recipient group ID."); subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*"); subparser.addArgument("-e", "--emoji") .required(true) @@ -45,7 +45,7 @@ public class SendReactionCommand implements DbusCommand { @Override public void handleCommand(final Namespace ns, final Signal signal) throws CommandException { final List recipients = ns.getList("recipient"); - final var groupIdString = ns.getString("group"); + final var groupIdString = ns.getString("group-id"); final var noRecipients = recipients == null || recipients.isEmpty(); if (noRecipients && groupIdString == null) { diff --git a/src/main/java/org/asamk/signal/commands/SendTypingCommand.java b/src/main/java/org/asamk/signal/commands/SendTypingCommand.java index cbf34a6d..77c1d70c 100644 --- a/src/main/java/org/asamk/signal/commands/SendTypingCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendTypingCommand.java @@ -28,7 +28,7 @@ public class SendTypingCommand implements LocalCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help( "Send typing message to trigger a typing indicator for the recipient. Indicator will be shown for 15seconds unless a typing STOP message is sent first."); - subparser.addArgument("-g", "--group").help("Specify the recipient group ID."); + subparser.addArgument("-g", "--group-id", "--group").help("Specify the recipient group ID."); subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*"); subparser.addArgument("-s", "--stop").help("Send a typing STOP message.").action(Arguments.storeTrue()); } @@ -36,7 +36,7 @@ public class SendTypingCommand implements LocalCommand { @Override public void handleCommand(final Namespace ns, final Manager m) throws CommandException { final var recipients = ns.getList("recipient"); - final var groupIdString = ns.getString("group"); + final var groupIdString = ns.getString("group-id"); final var noRecipients = recipients == null || recipients.isEmpty(); if (noRecipients && groupIdString == null) { diff --git a/src/main/java/org/asamk/signal/commands/UnblockCommand.java b/src/main/java/org/asamk/signal/commands/UnblockCommand.java index 412a904f..e4366393 100644 --- a/src/main/java/org/asamk/signal/commands/UnblockCommand.java +++ b/src/main/java/org/asamk/signal/commands/UnblockCommand.java @@ -25,7 +25,7 @@ public class UnblockCommand implements LocalCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help("Unblock the given contacts or groups (messages will be received again)"); subparser.addArgument("contact").help("Contact number").nargs("*"); - subparser.addArgument("-g", "--group").help("Group ID").nargs("*"); + subparser.addArgument("-g", "--group-id", "--group").help("Group ID").nargs("*"); } @Override @@ -40,8 +40,8 @@ public class UnblockCommand implements LocalCommand { } } - if (ns.getList("group") != null) { - for (var groupIdString : ns.getList("group")) { + if (ns.getList("group-id") != null) { + for (var groupIdString : ns.getList("group-id")) { try { var groupId = Util.decodeGroupId(groupIdString); m.setGroupBlocked(groupId, false); diff --git a/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java b/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java index 20c9649b..59e39394 100644 --- a/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java +++ b/src/main/java/org/asamk/signal/commands/UpdateGroupCommand.java @@ -42,7 +42,7 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand { public static void attachToSubparser(final Subparser subparser) { subparser.help("Create or update a group."); - subparser.addArgument("-g", "--group").help("Specify the recipient group ID."); + subparser.addArgument("-g", "--group-id", "--group").help("Specify the group ID."); subparser.addArgument("-n", "--name").help("Specify the new group name."); subparser.addArgument("-d", "--description").help("Specify the new group description."); subparser.addArgument("-a", "--avatar").help("Specify a new group avatar image file"); @@ -76,7 +76,7 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand { public void handleCommand(final Namespace ns, final Manager m) throws CommandException { final var writer = (PlainTextWriter) outputWriter; GroupId groupId = null; - final var groupIdString = ns.getString("group"); + final var groupIdString = ns.getString("group-id"); if (groupIdString != null) { try { groupId = Util.decodeGroupId(groupIdString); @@ -144,9 +144,9 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand { public void handleCommand(final Namespace ns, final Signal signal) throws CommandException { final var writer = (PlainTextWriter) outputWriter; byte[] groupId = null; - if (ns.getString("group") != null) { + if (ns.getString("group-id") != null) { try { - groupId = Util.decodeGroupId(ns.getString("group")).serialize(); + groupId = Util.decodeGroupId(ns.getString("group-id")).serialize(); } catch (GroupIdFormatException e) { throw new UserErrorException("Invalid group id: " + e.getMessage()); }