mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 11:00:38 +00:00
Add UnregisteredRecipientException
This commit is contained in:
parent
a7ecb9e10f
commit
c88c92086e
20 changed files with 244 additions and 117 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue