mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Refactor command creation
This commit is contained in:
parent
47143a90e1
commit
af292d8f0e
45 changed files with 436 additions and 282 deletions
|
@ -19,17 +19,22 @@ public class UnblockCommand implements JsonRpcLocalCommand {
|
|||
|
||||
private final static Logger logger = LoggerFactory.getLogger(UnblockCommand.class);
|
||||
|
||||
public UnblockCommand(final OutputWriter outputWriter) {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "unblock";
|
||||
}
|
||||
|
||||
public static void attachToSubparser(final Subparser subparser) {
|
||||
@Override
|
||||
public 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-id", "--group").help("Group ID").nargs("*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
|
||||
public void handleCommand(
|
||||
final Namespace ns, final Manager m, final OutputWriter outputWriter
|
||||
) throws CommandException {
|
||||
for (var contactNumber : ns.<String>getList("contact")) {
|
||||
try {
|
||||
m.setContactBlocked(contactNumber, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue