mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add sendSyncRequest command
This commit is contained in:
parent
36475bb632
commit
9e3c9db5c0
4 changed files with 42 additions and 10 deletions
|
@ -27,6 +27,7 @@ public class Commands {
|
|||
addCommand("send", new SendCommand());
|
||||
addCommand("sendContacts", new SendContactsCommand());
|
||||
addCommand("sendReaction", new SendReactionCommand());
|
||||
addCommand("sendSyncRequest", new SendSyncRequestCommand());
|
||||
addCommand("setPin", new SetPinCommand());
|
||||
addCommand("trust", new TrustCommand());
|
||||
addCommand("unblock", new UnblockCommand());
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package org.asamk.signal.commands;
|
||||
|
||||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
import net.sourceforge.argparse4j.inf.Subparser;
|
||||
|
||||
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 SendSyncRequestCommand implements LocalCommand {
|
||||
|
||||
@Override
|
||||
public void attachToSubparser(final Subparser subparser) {
|
||||
subparser.help("Send a synchronization request message to master device (for group, contacts, ...).");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
|
||||
try {
|
||||
m.requestAllSyncData();
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Request sync data error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue