signal-cli-rest-api icon indicating copy to clipboard operation
signal-cli-rest-api copied to clipboard

Add support of extra flags for `receive` command

Open xSAVIKx opened this issue 2 years ago • 2 comments

Feature Request

The receive endpoint now only supports the timeout argument, but the CLI also provides the following configs:

usage: signal-cli receive [-h] [-t TIMEOUT] [--max-messages MAX_MESSAGES] [--ignore-attachments] [--ignore-stories] [--send-read-receipts]

named arguments:
  -h, --help             show this help message and exit
  -t TIMEOUT, --timeout TIMEOUT
                         Number of seconds to wait for new messages (negative values disable timeout)
  --max-messages MAX_MESSAGES
                         Maximum number of messages to receive, before returning.
  --ignore-attachments   Don’t download attachments of received messages.
  --ignore-stories       Don’t receive story messages from the server.
  --send-read-receipts   Send read receipts for all incoming data messages (in addition to the default delivery receipts)

It would be great to add support for the other flags as well. IMO --ignore flags are especially helpful with the auto receive feature.

xSAVIKx avatar May 12 '23 19:05 xSAVIKx

When my service which uses REST API isn't up for a long time, and then I try to receive messages, I get {"error":"process killed as timeout reached"} and messages are lost. I would hope --max-messages analog would help.

k-bx avatar May 25 '23 05:05 k-bx

When my service which uses REST API isn't up for a long time, and then I try to receive messages, I get {"error":"process killed as timeout reached"} and messages are lost. I would hope --max-messages analog would help.

Currently, --max-messages isn't exposed via the REST API. But specifying a long timeout (e.g: GET /v1/receive?timeout=60) should work too.

bbernhard avatar May 26 '23 16:05 bbernhard