X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/53e7f831881fcbae894637b1cff832239f7ff3ed..faae998a7ee218b6134d0f773471e698d82bbf02:/src/main/java/org/asamk/signal/commands/SetContactNameCommand.java diff --git a/src/main/java/org/asamk/signal/commands/SetContactNameCommand.java b/src/main/java/org/asamk/signal/commands/SetContactNameCommand.java deleted file mode 100644 index d7cbedc6..00000000 --- a/src/main/java/org/asamk/signal/commands/SetContactNameCommand.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.asamk.signal.commands; - -import net.sourceforge.argparse4j.impl.Arguments; -import net.sourceforge.argparse4j.inf.Namespace; -import net.sourceforge.argparse4j.inf.Subparser; -import org.asamk.signal.manager.Manager; - -public class SetContactNameCommand implements LocalCommand { - - @Override - public void attachToSubparser(final Subparser subparser) { - subparser.addArgument("number") - .help("Contact number"); - subparser.addArgument("name") - .help("New contact name"); - subparser.help("Set the name of a given contact"); - } - - @Override - public int handleCommand(final Namespace ns, final Manager m) { - if (!m.isRegistered()) { - System.err.println("User is not registered."); - return 1; - } - - String number = ns.getString("number"); - String name = ns.getString("name"); - - m.setContactName(number, name); - - return 0; - } - -}