How do I get unread message count on a channel with message filtering?

I currently have a channel that does some filtering based on a message’s customType. When I retrieve the unreadMessage count from the channel, it includes all messages even those that were filtered. Is there a way to retrieve this count accounting for the message filtering? Could an isRead property be added to the message’s schema upon getting user messages to know which messages should be marked as new.

Hi @tiopi. I will try to answer your questions.

  • Is there a way to retrieve this count accounting for the message filtering? =>Unfortunately, you can’t apply the custom type filter for unread message counts yet. it includes all messages.

  • Could an isRead property be added to the message’s schema upon getting user messages to know which messages should be marked as new? => It’s better to do it by comparing timestamps (last chat open timestamp and message timestamp). You need to save the channel_url and the latest view timestamp to the local DB when users leave the chat window. When the user opens the chat screen, you will retrieve the latest viewed timestamp and compare it with message timestamps. If message timestamps are after the latest viewed timestamp, you will show the messages as new.