powered by Jive Software

Unable to get Offline Messages in Group Chat

I am working on an Android and iOS app, I am using XMPP protocol and Open Fire for Peer to Peer chat and its working fine.

But now I am working on Group Chat, and stuck at Offline Message section.

  1. I need to understand how to figure out which user in the group is offline?
  2. How to target offline users and send them the notification of the message?
  3. How to get the total unread messages if the user is offline?
  4. How to get the history of the Group if the user comes online after a long time?

Let me know how to resolve this.
or else let me know if you need any more information.

@Flow This is my problem, so I have created a topic, so if you can or @guus can respond to this.

Thank you
Waiting for your response

Group chat is called Multi-User Chat (MUC) in Openfire. It is based on the XMPP protocol extension specified in XEP-0045: Multi-User Chat. To understand the details of how MUC in Openfire works, I advise that you study that specification.

In its most common form, users join a MUC-Room (“a group chat”) only when they are online. When their client logs off, they leave the room. In this sense, there is not a concept of a user-that-is-in-the-room-but-is-offline.

MUC rooms can have members. That, for instance, can be used to reserve a nickname, or to restrict access to the room. If you make sure that your solution registers your users as members of the room that they are in, then you can detect at any given time what users are ‘offline’. To do that, you can compare the member list of the room with the users that are currently in the room.

Offline users can be sent messages by simply addressing the message to their XMPP address (JID). Whenever the user logs in, its client will be sent the offline messages (see XEP-0160: Best Practices for Handling Offline Messages) This works well in a one-to-one setting, but is not applicable to a MUC setting.

For a user to retrieve messages from a MUC room, it is best to configure Openfire to maintain an archive of messages (normally, Openfire only keeps the last few messages). To do this, you install the Monitoring plugin for Openfire, and configure it to record messages. Among other things, the Monitoring plugin provides functionality as described in XEP-0313: Message Archive Management. A client that joins a MUC room can use that to retrieve all (or part of) the messages that are in the archive of the MUC room.

To send users that are offline a notification that messages are pending, you might need to resort to push notifications. Support for that is provided by the Push Notifications plugin. This plugin currently (version 0.6.0) has only very basic support of the protocol defined in XEP-0357: Push Notifications. Your mileage may vary - and depending on the platform that your client is on, might require extensive development or other components to be installed before you can make this work. Also, I do not believe that it supports sending push notifications based on receiving messages in a MUC room that a user is a member of, but not online in.

Thank you for the solution, I guess its pretty much solving the issue. Will get back to you if there is anything in this