Re: [conversejs] Display unread message count inside roster
- Lamtei W
- 2015-09-10 @ 07:33
I think you have to call the incrementMsgCounter function in some
appropriate method inside the RosterContactView, the same way it is being
called inside the ChatBoxView onMessageAdded function. Just take a look you
might figure out something. Hope it helps.
On Wed, Sep 9, 2015 at 6:05 PM, J M <email@example.com> wrote:
> I'm trying to show a custom unread message counter which includes the
> count of messages received offline, next to each contact name in the roster
> I've already written out the server side code required to return the
> offline message count, and some code for conversejs that will post to the
> server to mark messages as read whenever the chat window is opened. I've
> also gotten the css changed to accommodate the display of this unread
> message count nicely.
> Now, I'm stuck on how to access message or listen to message received
> events inside RosterContactView so that I can increment the unread message
> counter. I've looked at the MinimizedChats view code but it had the
> chatboxes passed in directly inside the View's constructor so it clearly
> has access to the messages. Any pointers?
> Thank you