user2550587
user2550587

Reputation: 645

How to send system message to group/ user using XMPP protocol?

What are the best practices for sending system message/s to group/ user, while using XMPP protocol? All the users at at the group should receive the message. How can I achieve it?

Possible solutions that might be useful:

  1. The announce - I have encountered with the announce and more specifically this module.
  2. Publish-Subscribe http://www.xmpp.org/extensions/xep-0060.html
  3. There is always the option of creating an admin user that will send messages.

Thanks in advance.

Upvotes: 2

Views: 1994

Answers (1)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

The best approach depends on your constrain and especially if you control the client. For example, if you use a client you did not develop, it may not render the pubsub messages fine.

The second thing to consider if how are the group defined. Are users registering for alerts ? In that case in seems to match the pubsub case. Otherwise, if groups are not too large, you may use an admin user to send to the list of user you want. You can even send a single message to multiple users using XEP-0033: Extended Stanza Addressing (Sometimes called "multicast").

mod_announce can only target all users or all online users, so it does not seem to match your need in terms of "groups".

I explained most of the option in a talk (video and slides): https://blog.process-one.net/implementing-state-of-the-art-one-to-many-chat-services-with-ejabberd-ejabberd-workshop-1/

It is broader as it not only cover broadcast but also groupchat, but it should help clarifying your choice.

Upvotes: 2

Related Questions