mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-16 04:04:28 +01:00
Add UnregisteredRecipientException
This commit is contained in:
@@ -5,13 +5,10 @@ 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 org.asamk.signal.output.OutputWriter;
|
||||
import org.asamk.signal.util.CommandUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RemoveContactCommand implements JsonRpcLocalCommand {
|
||||
|
||||
@Override
|
||||
@@ -36,14 +33,10 @@ public class RemoveContactCommand implements JsonRpcLocalCommand {
|
||||
var recipient = CommandUtil.getSingleRecipientIdentifier(recipientString, m.getSelfNumber());
|
||||
|
||||
var forget = Boolean.TRUE == ns.getBoolean("forget");
|
||||
try {
|
||||
if (forget) {
|
||||
m.deleteRecipient(recipient);
|
||||
} else {
|
||||
m.deleteContact(recipient);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Remove contact error: " + e.getMessage(), e);
|
||||
if (forget) {
|
||||
m.deleteRecipient(recipient);
|
||||
} else {
|
||||
m.deleteContact(recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user