tinode / tinode-js

Tinode javascript bindings
Apache License 2.0
52 stars 42 forks source link

Unread message count #27

Closed pulsegame closed 4 years ago

pulsegame commented 4 years ago

hi, I made a group chat application and tried to implement a feature to show how many unread message count of each group. I am using http://tinode.github.io/js-api/Tinode.html#getMeTopic, it works, but! it always have delay. For example, one group showing 2 unread messages and user enter into the group to read the content and! it will not become to 0 unread message immediately (means it always take another 5-15 seconds it become to 0) when user back to group list. It like some cache or I am not sure if I used the getMeTopic in wrong way or there are any better implementation.

Thanks for your guide!

Br, Lin

or-else commented 4 years ago

The delay is 1 second and it's intentional: https://github.com/tinode/webapp/blob/d30b616b26f2e5015ab94483a6c2b83a9c3730fe/src/config.js#L23

It's meant to represent that the user needs some time to read the message.

or-else commented 4 years ago

Is this resolved?