mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
28 lines
863 B
Java
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;
|
|
}
|
|
}
|
|
}
|