mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
35 lines
1 KiB
Java
35 lines
1 KiB
Java
package org.asamk.signal.commands;
|
|
|
|
import net.sourceforge.argparse4j.inf.Namespace;
|
|
import net.sourceforge.argparse4j.inf.Subparser;
|
|
|
|
import org.asamk.signal.OutputWriter;
|
|
import org.asamk.signal.commands.exceptions.CommandException;
|
|
import org.asamk.signal.commands.exceptions.IOErrorException;
|
|
import org.asamk.signal.manager.Manager;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class SendContactsCommand implements JsonRpcLocalCommand {
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "sendContacts";
|
|
}
|
|
|
|
@Override
|
|
public void attachToSubparser(final Subparser subparser) {
|
|
subparser.help("Send a synchronization message with the local contacts list to all linked devices.");
|
|
}
|
|
|
|
@Override
|
|
public void handleCommand(
|
|
final Namespace ns, final Manager m, final OutputWriter outputWriter
|
|
) throws CommandException {
|
|
try {
|
|
m.sendContacts();
|
|
} catch (IOException e) {
|
|
throw new IOErrorException("SendContacts error: " + e.getMessage(), e);
|
|
}
|
|
}
|
|
}
|