AsamK / signal-cli

signal-cli provides an unofficial commandline, JSON-RPC and dbus interface for the Signal messenger.
GNU General Public License v3.0
3.17k stars 299 forks source link

sendReceipt should send sync message #1570

Closed Huakas closed 3 weeks ago

Huakas commented 1 month ago

When you send a read receipt using the signal-cli -a <account1> sendReceipt -t <timestamp> <account2> command, the recipient (account2) gets notified that you read their message, but all the devices from account1 still think that the account has not yet read the message.

When you however click on a message using the Signal Desktop or Android App, in addition to the recipient (account2) getting notified, it also sends a syncMessage to itself (account1) that looks like this:

Envelope from: “Account 1” <account1> (device: 1) to <account1>
Timestamp: 1724265071110 (2024-08-21T18:31:11.110Z)
Server timestamps: received: 1724265071164 (2024-08-21T18:31:11.164Z) delivered: 1724265863758 (2024-08-21T18:44:23.758Z)
Received a sync message
Received sync read messages list
- From: “Account 2” <account2> Message timestamp: 1724264957132 (2024-08-21T18:29:17.132Z)

or with --output json:

[
  {
    "envelope": {
      "source": "<account1>",
      "sourceNumber": "<account1>",
      "sourceUuid": "<uuid>",
      "sourceName": "Account 1",
      "sourceDevice": 1,
      "timestamp": 1724265071110,
      "syncMessage": {
        "readMessages": [
          {
            "sender": "<account2>",
            "senderNumber": "<account2>",
            "senderUuid": "<uuid>",
            "timestamp": 1724264957132
          }
        ]
      }
    },
    "account": "<account1>"
  }
]

<account1> = phone number of account 1 <account2> = phone number of account 2 <uuid> = some UUID, not important

Is there a way to notify the other linked devices when i send a sendReceipt command that the message has now been read? It's not listed in the man page so i imagine there's not. Could someone with more coding knowledge maybe add a flag for the sendReceipt command, something like --notify-self so that other linked devices get this readMessages sync message?

AsamK commented 3 weeks ago

Thanks for reporting, the sendReceipt command will be adapted in the next version to send sync messages to linked devices.