Add sendSyncRequest command

This commit is contained in:
AsamK 2021-05-03 20:37:13 +02:00
parent 36475bb632
commit 9e3c9db5c0
4 changed files with 42 additions and 10 deletions

View file

@ -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());
}
}
}