Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unread message counter per registered user. #86

Open
nanu-c opened this issue Jan 4, 2023 · 2 comments
Open

Unread message counter per registered user. #86

nanu-c opened this issue Jan 4, 2023 · 2 comments
Milestone

Comments

@nanu-c
Copy link
Contributor

nanu-c commented Jan 4, 2023

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
Copy link
Collaborator

gferon commented Jan 11, 2023

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
Copy link
Contributor Author

nanu-c commented Jan 11, 2023

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

  • the client asks for messages and the timestamp is inside -> or we make it more simple like get message in chat x resets the counter for x
  • we receive a sync message that was send from another device. -> indication for messages were read some where else
  • we receive a data message -> increment by 1
    That means, we can implement the message read functionality of signal

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

@gferon gferon added this to the 0.6.0 milestone Apr 21, 2023
@gferon gferon modified the milestones: 0.6.0, 0.7.0 Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants