X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/d51dd7ae575222b0baea7265c18ebc79f4a7b001..fc2e9bbfaec8dbe6e317b951c0d28fa2e9421347:/src/main/java/org/asamk/signal/commands/SendReceiptCommand.java diff --git a/src/main/java/org/asamk/signal/commands/SendReceiptCommand.java b/src/main/java/org/asamk/signal/commands/SendReceiptCommand.java index 1eec6c99..adae7c4d 100644 --- a/src/main/java/org/asamk/signal/commands/SendReceiptCommand.java +++ b/src/main/java/org/asamk/signal/commands/SendReceiptCommand.java @@ -10,8 +10,6 @@ import org.asamk.signal.manager.api.SendMessageResults; import org.asamk.signal.output.OutputWriter; import org.asamk.signal.util.CommandUtil; -import java.io.IOException; - import static org.asamk.signal.util.SendMessageResultUtils.outputResult; public class SendReceiptCommand implements JsonRpcLocalCommand { @@ -45,19 +43,14 @@ public class SendReceiptCommand implements JsonRpcLocalCommand { final var targetTimestamps = ns.getList("target-timestamp"); final var type = ns.getString("type"); - try { - final SendMessageResults results; - if (type == null || "read".equals(type)) { - results = m.sendReadReceipt(recipient, targetTimestamps); - } else if ("viewed".equals(type)) { - results = m.sendViewedReceipt(recipient, targetTimestamps); - } else { - throw new UserErrorException("Unknown receipt type: " + type); - } - outputResult(outputWriter, results); - } catch (IOException e) { - throw new UserErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass() - .getSimpleName() + ")"); + final SendMessageResults results; + if (type == null || "read".equals(type)) { + results = m.sendReadReceipt(recipient, targetTimestamps); + } else if ("viewed".equals(type)) { + results = m.sendViewedReceipt(recipient, targetTimestamps); + } else { + throw new UserErrorException("Unknown receipt type: " + type); } + outputResult(outputWriter, results); } }