%ents; ]>
Message Stanza Profiles This document specifies best practices for generating and handling extended content in XMPP message stanzas. &LEGALNOTICE; 0226 Deferred Informational Standards Council profiles &infiniti; &stpeter; 0.3 2008-11-05 psa

For consistency, defined Metadata Profile; specified that the registrar shall create a registry for message stanza profiles.

0.2 2008-10-01 jk

Revised/reordered text.

0.1 2007-08-08 psa

Initial published version; specified more granular profiles; renamed transmission elements to metadata elements.

0.0.2 2007-08-01 psa

Clarified that message profiles apply to sending entities as well as receiving entities.

0.0.1 2007-08-01 jk/psa

First draft.

The definition of XMPP stanzas in &xmppcore; and &xmppim; allows a &MESSAGE; stanza to include any number of child elements that define extended content. The fact that a message stanza may contain multiple instances of extended content can make it difficult for sending entities to know what is appropriate for inclusion in a message stanza and for receiving entities to know exactly how to process a message stanza.

Consider the following hypothetical example:

Shall we meet?

Shall we meet?

romantic_meetings
high
Italy 45.44 Venice 12.33 qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA ]]>

What to make of a message like this? The import seems to be that Romeo, being in a flirtatious mood (&xep0107;) and currently located near Juliet's abode (&xep0080;), would urgently (&xep0131;) like to meet with Juliet (message body) and proposes two convenient places (&xep0020;) for an evening tryst, but no later than midnight (&xep0079;), and for good measure would like to transport the 85th packet of a file transfer. But how is Juliet's client supposed to figure that out? That is, what should her client present to the user? And should Romeo's client even send a monstrosity such as this?

To clarify such matters, this document introduces the concept of "message stanza profiles". Each profile defines a set of elements that are allowed for use, and each message stanza must only be processed under the rules of a single profile. Therefore, at best, Juliet's client in the above example would process the message for just one of its many intended purposes. At worst, the message would be rejected by Juliet's client as invalid. Romeo's client should not be sending such a monstrosity.

Elements used in a message stanza are either part of a standard profile (for example, <body> or <data xmlns='http://jabber.org/protocol/ibb'>) or the metadata profile (for example, <error> or <amp xmlns='http://jabber.org/protocol/amp'>). A message stanza SHOULD only contain profile elements that are part of the same profile. A message stanza MAY contain as many elements as necessary from the metadata profile.

A sender MAY mix elements of different profiles only for the purposes of fallback. For example, it may be useful to include a <body> element in a message that is not intended to be displayed as a text message, in case the recipient does not support the primary profile of the message.

If you read this message then you don't support IBB. qANQR1DBwU4DX7jmYZnncmUQB/9KuKBddzQH+tZ1ZywKK0yHKnq57kWq+RFtQdCJ WpdWpR0uQsuJe7+vh3NWn59/gTc5MDlX8dS9p0ovStmNcyLhxVgmqS8ZKhsblVeu IpQ0JgavABqibJolc3BKrVtVV1igKiX/N7Pi8RtY1K18toaMDhdEfhBRzO/XB0+P AQhYlRjNacGcslkhXqNjK5Va4tuOAPy2n1Q8UUrHbUd0g+xJ9Bm0G0LZXyvCWyKH kuNEHFQiLuCY6Iv0myq6iX6tjuHehZlFSh80b5BVV9tNLwNR5Eqz1klxMhoghJOA ]]>

A receiver MUST only process the message for a single profile. The above example message would be processed either as an IBB data packet or as an instant message, but never both.

We stipulate the following rules:

  1. A single profile applies to each message stanza (i.e., a message is not in two or more profiles).
  2. Each element is part of a defined profile.
  3. Metadata elements have no effect on the profile-based handling of messages.
  4. Unknown elements have no effect on determining the profile.
  5. If a received message appears to conform to multiple profiles, the profile selected by the receiver is implementation-specific with one exception: the receiver MUST NOT select the IM profile unless that is the only profile it understands in the message.

If a client receives a message stanza that combines multiple profiles, or the profile cannot be determined, the client MAY return a stanza error, which SHOULD be ¬acceptable;.

]]>

A client might determine that a message cannot be assigned to any profile (e.g., a message stanza that is empty or that contains only whitespace A message stanza SHOULD NOT be empty or contain only whitespace, but some clients are known to generate such stanzas., or that contains only unknown elements).

Profiles can be defined in whichever specifications define elements or processing behavior related to message stanzas. All such profiles SHOULD be registered in the Message Profiles Registry as described in the XMPP Registrar Considerations. However, a few profiles are defined here, and this specification might be kept up to date as further registrations are created.

The instant messaging (IM) profile is the "default" profile for message stanzas. For example, if a message stanza includes only elements that are defined for the 'jabber:client' namespace then it is in the IM profile. If a message stanza includes both IM profile elements and other elements, the IM elements should be considered a fallback and the profile should be determined based on the other elements if supported (e.g., a data form). A sending entity should limit the elements it includes to IM profile elements, unless the IM elements are a fallback.

The extended content defined in the following specifications is considered to be in the IM profile:

  • &xmppim;
  • &xep0045; (e.g., invitations)
  • &xep0066;
  • &xep0071;
  • &xep0085;
  • &xep0144;
  • &xep0172;

Extended content elements defined in &xep0004; are considered to be in the Data Forms profile.

Extended content elements defined in &xep0009; are considered to be in the RPC profile.

Extended content elements defined in &xep0020; are considered to be in the Feature Negotiation profile.

Extended content elements defined in &xep0070; are considered to be in the HTTP Authentication profile.

Extended content elements defined in &xep0072; are considered to be in the SOAP profile.

Extended content elements defined in &xep0155; are considered to be in the Stanza Session Negotiation profile.

The metadata profile is handled differently than the other, "standard" profiles, but is defined as a profile for the purpose of consistency. Metadata elements are included to define how the message stanza shall be routed, delivered, or processed in transit or by the end recipient. Metadata elements shall not be used to determine which standard profile applies. If a message stanza includes only metadata elements, it can be considered to have no standard profile.

The extended content elements defined in the following specifications are considered to be metadata elements:

  • &xep0033;
  • &xep0079;
  • &xep0131;
  • &xep0203;

Since each message is unambiguously determined to be of a specific profile, implementations that use filtering to pass message stanzas to an appropriate handler (a very common XMPP implementation approach) need not be concerned with the filtering order. This is because only one handler should ever match on the filter expression.

This document adds no security concerns or consideration above and beyond those specified in the specifications to which it refers.

This document requires no interaction with &IANA;.

A future version of this specification may call for the ®ISTRAR; to establish a registry of message stanza profiles, so that each relevant specification shall define which profile applies to extended content qualified by the relevant namespace.

The XMPP Registrar shall maintain a registry of message profiles.

®PROCESS; the XML character data of the profile element a natural-language description of the message profile one "spec" element for each document that applies ]]> Data Forms XEP-0004 Feature Negotiation XEP-0020 HTTP Authentication XEP-0070 IM XMPP core XEP-0045 XEP-0066 XEP-0071 XEP-0085 XEP-0144 XEP-0172 Metadata XEP-0033 XEP-0079 XEP-0131 XEP-0203 RPC XEP-0009 SOAP XEP-0072 Stanza Session Negotiation XEP-0155 ]]>