How to find out a first id of an unread message
How to find out a first id of an unread message? Or how to know what number of messages to skip to get first unread message and also messages around?
Right now I am implemented it in my client just like I have number of unread messages in room, so I just skip number of unread messages, but it does not work in this situation:
id | status |
---|---|
7 | unread |
6 | unread |
5 | unread |
4 | read |
3 | read |
2 | read |
1 | read |
Here we have 3 unread messages, so skip 3 messages. And it is wrong. What I want is to know is a method where I get id of a first unread message(7), it would be better if I can do it in 1 request. Thanks
Edited by Anton Kumin