signal-cli/src/main/java/org/asamk/signal/commands/SendContactsCommand.java
2021-01-10 23:06:13 +01:00

28 lines
863 B
Java

package org.asamk.signal.commands;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.manager.Manager;
import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
import java.io.IOException;
public class SendContactsCommand implements LocalCommand {
@Override
public void attachToSubparser(final Subparser subparser) {
subparser.help("Send a synchronization message with the local contacts list to all linked devices.");
}
@Override
public int handleCommand(final Namespace ns, final Manager m) {
try {
m.sendContacts();
return 0;
} catch (IOException | UntrustedIdentityException e) {
System.err.println("SendContacts error: " + e.getMessage());
return 3;
}
}
}