O'Reilly logo

XMPP: The Definitive Guide by Remko Tronçon, Kevin Smith, Peter Saint-Andre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Multi-Party Interactions

Starting the Party

Instant messaging as we’ve explored it to this point is a one-to-one interaction. But what if we want to communicate among multiple people, bots, or other entities at the same time? It would be nice if XMPP technologies included a real-time counterpart to email discussion lists, web forums, and other multi-party interactions. This feature would be similar to Internet Relay Chat (IRC), providing channels or rooms where people could exchange messages and see who else is present. Well, you’re in luck, because XMPP includes just such a feature! The first iteration of this technology was called groupchat, while the more modern iteration is called Multi-User Chat (MUC) XEP-0045.

The basic idea behind MUC is that people can join a room and send messages that are delivered to all the other participants. Thus the room acts as a kind of message “reflector” or “multiplier” (one incoming message is multiplied into many outgoing messages). You can see a typical interface for such a groupchat in an IM client in Figure 7-1.

A snippet of conversation from the tea party groupchat room
Figure 7-1. A snippet of conversation from the tea party groupchat room

Let’s go over a few of the features:

  • Messages are shared with all the participants (as we’ll see, you can also send private messages to specific participants).

  • There is a “room roster” of all the participants.

  • The participants are identified by nicknames, not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required