%ents; ]>
MUC presence versioning This specification defines a versioning mechanism which reduces the amount of presence traffic in a XEP-0045 MUC &LEGALNOTICE; 0436 Experimental Standards Track Standards Council XMPP Core XMPP IM XEP-0045 omnipresent-muc-affiliates &jcbrand; &mwild; 0.2.0 2020-05-10 jcb

Incorporate feedback from the standards list

  • Create a separate tag for sending the version number.
  • Include a reset token.
  • Remove the "Additional measures" section and merge parts into "Requirements".
  • Mandate that presences are always sent for affiliated users.
0.1.0 2020-05-05 XEP Editor (jsc) Accepted by vote of Council on 2020-04-01. 0.0.1 2020-03-30 jcb

First draft

Many modern-day non-XMPP groupchat implementations have discarded the metaphor of physical presence inside a room that a user must enter and exit, as implemented by &xep0045;. The newer &xep0369; has therefore made presence subscriptions optional.

Often it no longer makes sense for a chat service to require that a user is "present" in order for them to be addressed by other occupants or to receive messages, especially if the chat implementation will inform you out-of-band, for example via push notifications or email. The notion of "room presence" is therefore less relevant than before, and in some cases can be done away with entirely.

Broadcasting all XEP-0045 MUC participants' presences to one another scales quadratically (O(n^2)) and can greatly increase the amount of network traffic, for potentially negligable gain.

Even though the metaphorical concept of presence inside a room might no longer be relevant for a groupchat implementation, <presence/> stanzas might still contain useful metadata, such as the user's affiliation or &xep0317;.

This XEP defines a versioning mechanism (similar to roster versioning in &rfc6121;) whereby the amount of presence traffic in a MUC may be greatly reduced.

A client that supports MUC presence versioning needs to keep track and store the presence states of all MUC occupants, across multiple MUC sessions. Similarly, a MUC service which supports presence versioning will also need to maintain a changelog of version numbers and corresponding presence states.

Before the client enters a MUC, it SHOULD use service discovery to check whether presence versioning is supported (see determining support below.). If MUC presence versioning is supported, the client MAY include a <version> tag with a 'ver' attribute set to the last known version inside the <{http://jabber.org/protocol/muc#user}x> tag of the <presence/> stanza, which it sends to join the MUC.

If MUC presence versioning is not supported by the server, the client MUST NOT include a 'ver' attribute.

]]>

The MUC will return only those presences that have changed since the version indicated by the client, and in the self-presence of the joining user it will add a <version> tag with a 'ver' attribute set to the latest version number inside the <{http://jabber.org/protocol/muc#user}x> tag. The client must save the version number (and continuously update with never versions as they're received) and use that next time it joins the MUC.

]]>

When presence versioning is enabled, every subsequent <presence/> stanza sent by the server MUST include a new version number, which replaces the existing one saved by the client.

If a MUC implements presence versioning, it MUST specify the 'urn:xmpp:muc-presence-versioning:0' feature in its service discovery information features, as specified in &xep0030;.

]]> ... ... ]]>

A MUC that supports presence versioning MUST broadcast presence for all affiliated users, including those who are currently 'unavailable'. XEP-0045 documents the status code '102', which is used to indicate that a MUC shows unavailable members.

The only exception is when a MUC has been explicitly configured to only broadcast presence from occupants above a certain affiliation, (see the presence broadcast section of XEP-0045).

In order for a user to permanently join a room, and therefore become affiliated so that they are included in presence broadcasts, they MAY be allowed to register themselves as members in the MUC. XEP-0045 describes in section 7.10 "Registering with a Room how a user may register themselves with a room, thereby receiving the "member" affiliation and having their preferred nickname reserved in that room.

If a MUC receives a presence version number that's so old, that it no longer has the corresponding state available, it MUST include a <reset> token in the first <presence> stanza it sends (regardless of whom in the MUC the presence relates to). The first presence stanza MAY be from the MUC itself (as shown in the example below). Afterwards, the MUC MUST then send all presences (including 'unavailable' for affiliated users) as if the client is starting from a blank slate.

]]>

Even if the client did not include a <version> tag with a 'ver' attribute in its "join" <presence/> stanza, the server SHOULD still return a <version> tag with 'ver' attribute (set to the latest version number) on all relevant <presence/> stanzas. This allows clients to bootstrap MUC presence versioning without having to do a service discovery query first.

If the client has not yet saved a presence version number and the corresponding presence states, then it MUST bootstrap presence versioning by sending a 'ver' attribute set to the empty string (i.e., ver="").

In some cases, the presence states being kept track of by the MUC service MAY be reduced to a minimum of only two states, 'available' and 'unavailable'. This can drastically reduce the number of states the server needs to keep track off, at the cost of not allowing users to provide more fine-grained reporting of their level of availability.

The MUC service should strip the <version> tag from the user's <presence> before relaying it to other occupants, to avoid leaking information on when last the user joined the MUC.

None.

The ®ISTRAR; includes 'urn:xmpp:muc-presence-versioning:0' in its registry of protocol namespaces (see &NAMESPACES;).

  • urn:xmpp:muc-presence-versioning:0
&NSVER;