whisperfish / presage

A high-level Rust library to help write clients for the Signal Messenger.
GNU Affero General Public License v3.0
118 stars 23 forks source link

Handle message receipts #141

Open gferon opened 1 year ago

gferon commented 1 year ago

And mark messages as seen/read in the store.

aeblyve commented 6 months ago

I might be able to find the time to take a look at this. It /appears/ to be a more simple project:

  1. When a message is received, queue up a message receipt, and send it in a resilient way (avoid a bug where the receipt doesn't get sent because of hardware shutdown etc). Maybe this should be more of a client-exposed feature, i.e., implement message.acknowledge or acknowledge(message_id)?
  2. When receiving a receipt, mark the message as read.

Group chats might complicate things a bit, I am not sure.

Anything I need to know/read before hacking?

gferon commented 6 months ago

Sounds good, any help is appreciated!

w.r.t the API, you're definitely right that presage would benefit from having a queue of messages that are waiting to be sent and this is kind of the reason why we currently don't have this (read receipts). Sending messages interleaved with receiving messages, especially when syncing, makes everything dead slow.

If you feel up for it, maybe we can start by adding a method in the public API like you suggested? Something like Manager::mark_message_as_read(id)?