Suggestions Needed for Unread Notifications and Offline Messages in Openfire POC

Hi,

I am currently working on a POC using Openfire. So far, I have been able to achieve features like sending messages in group chats and broadcasting messages. However, I’m facing challenges with the following requirements and would appreciate suggestions or best practices on how to achieve these (both from the Frontend(React with @xmpp/client) and Backend(Java) ):

1) Unread Message Notifications:
When a user is active in one chat room, they don’t see notifications for new messages arriving in other rooms. How can we track unread messages across rooms and display notifications to the user?

2) Offline Message Retrieval:
How can we retrieve and display all messages sent in chat rooms while a user was offline, once they log back in?

Hi, I have the same issue with openfire5.0.1 using converse.js 6.0.1 when sending 2 messages when recipient is offline online first message received?many thx for you help

1 Like

Hi @guus , I have submitted two queries earlier and would like to include an additional one now. Could you please review and respond to all?

  1. User Liveliness Status:
    How is the real-time status of users displayed, indicating online or offline?
  1. In XMPP it is perfectly reasonable to join more than one chat room at the same time. Even if the front-end client only shows activity from one room, the user can have joined other rooms. A user (that has an active connection/session with the server) will receive live messages (and other events) for every room that it has joined. Determining how to render those events then becomes a matter of UI implementation.
  2. Message archive management can be performed in a number of ways. The most common manner is described by the Message Archive Management specification, which is implemented by Openfire’s Monitoring plugin. It is rather flexible, and can be used for many things. A simple approach would be for a client to remember the last message that it received (in a particular MUC room) and ask the server-sided archive for any messages since that message.
  3. What you refer to as ‘liveliness’ is named ‘presence’ in XMPP. It is one of three basic data structures (stanzas) that are defined by the core protocol. You can expect this to be implemented in basically any XMPP library (including, obviously, Openfire). It is an elaborate mechanism, which I can’t easily explain in a forum post. I suggest that you read up on the documentation yourself. We can take it from there. A good entry point for learning about how this works is section 3 of RFC 6121.
1 Like

many thanks Guus for your accurate answer! Monitor service plugin solved the issue for offline messages.