I’m working with the Client4 and websocket portions of the mattermost-redux package to implement a custom client in React, and I’m trying to determine the correct “recipe” to find and maintain the number of unread messages in a given channel.
I’ve come across the Client4
getPostsSince method that lets me get the posts in a given channel since a given post ID. This seems like it might be a way to get the number of unread posts as longs as the last time the user viewed a specific channel is known. Is the information on when the user last viewed a channel available via the API?
Alternatively, is there a more effective way of determining and maintaining the number of unread messages per channel? Is there a “recipe” or tutorial covering this topic?