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

Reply to specific messages

Open baseljd opened this issue 3 years ago • 2 comments

Feature Request

Are we able to reply to specific messages using the /send endpoint? Maybe sending the message id we would like to reply to along with the message.

Is it possible to support this?

baseljd avatar Jul 28 '22 11:07 baseljd

I don't think so. What I see when I receive a reply to a specific message is that the dataMessage node contains an additional json node of 'quote'. Example below. Looks like this needs to be implemented.

"dataMessage": {
      "timestamp": 1667352320729,
      "message": "Reply to you",
      "expiresInSeconds": 0,
      "viewOnce": false,
      "quote": {
        "id": <redacted>,
        "author": <redacted>,
        "authorNumber": <redacted>,
        "authorUuid": <redacted>,
        "text": "false",
        "attachments": []
      }
    }

kevincw01 avatar Nov 02 '22 01:11 kevincw01

The upstream signal-cli GitHub does support it so its feasible to update this github source to support:

#[rpc(name = "send", params = "named")]
    fn send(
        &self,
        account: Option<String>,
        recipients: Vec<String>,
        #[allow(non_snake_case)] groupIds: Vec<String>,
        #[allow(non_snake_case)] noteToSelf: bool,
        #[allow(non_snake_case)] endSession: bool,
        message: String,
        attachments: Vec<String>,
        mentions: Vec<String>,
        #[allow(non_snake_case)] quoteTimestamp: Option<u64>,
        #[allow(non_snake_case)] quoteAuthor: Option<String>,
        #[allow(non_snake_case)] quoteMessage: Option<String>,
        #[allow(non_snake_case)] quoteMention: Vec<String>,
        sticker: Option<String>,
        #[allow(non_snake_case)] storyTimestamp: Option<u64>,
        #[allow(non_snake_case)] storyAuthor: Option<String>,
    ) -> Result<Value>;

kevincw01 avatar Nov 02 '22 03:11 kevincw01