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

Unread message counter per registered user. #86

Open nanu-c opened 1 year ago

nanu-c commented 1 year ago

It should be possible to get a sessions list with Name/username/groupname as title, a unread counter and last message, how would you do that?

gferon commented 1 year ago

How would you like to have this implemented? We currently have access to a stream of messages, ordered by server-side timestamp. I suppose we could add a simple setter/getter to the store per thread? That way, clients can mark where the cursor is set.

nanu-c commented 1 year ago

Actually i don't know how cursors work in sled. I had the idea of adding a tree similar to one for the messages that keeps the ids of the unread messages. Then we can use .count() for getting the actual number. There store is updated when

I would keep the logic as much as possible inside presage, but we can provide a setter/getter, too.