When initially run, a messaging client typically shows some list of contacts and chatrooms, and whether any new messages are present in each.
The current mechanism for achieving this UX involves a complete synchronization of the server-side archive, and is both time-consuming and bandwidth-intensive. This specification proposes a solution to directly obtain such data from the server.
Moreover, the information gathered by the server to support this can be used in support of mobile push notifications.
The Inbox consists semantically of a list of conversations in order of last activity. Each conversation is identified by a jid - for group chats this would be the chatroom, and for individual contacts this would be their bare jid.
Each Inbox entry includes a count of messages considered new, the last MAM stanza-id relating to this conversation, and the last MAM result for this conversation, as defined by Message Archive Management (XEP-0313) . In addition, a client-controlled boolean marker can be used to indicate a manual "set unread" state.
Finding more messages from this conversation can be achieved via a MAM query using
with to specify the
An <iq/> of type "get" is used, containing a single element
<inbox/>, containing an optional RSM
filter as specified by Result Set Management (XEP-0059) . This will typically be sent only to the user's own bare jid. If a client
requests the inbox without RSM, the server MAY limit the number of conversations arbitrarily by either time or number. This element has a number of attributes:
unread-only- Defaults to false. If true, the server will list only conversations with at least one unread message.
messages- Defaults to true. If true, the server includes the last message; if false, this is elided.
responds with a sequence of <message/> stanzas, each containing an
<entry/> element qualified by the
urn:xmpp:inbox:1 namespace with a number of attributes:
jid- contains the Jid of the conversation for this entry.
unread- contains a count of messages which are deemed to be unread by the server. Clients may use this to indicate unread messages to the user.
id- contains the last id in the MAM archive for this conversation. Clients may use this as a marker to fetch additional messages (or collated fastenings, see MAM Fastening Collation (XEP-0427) ) about the conversation via MAM.
messages attribute is missing or set to
<entry/> element is followed by the latest instant message, if any, which is encapsulated as a
<result/> element as defined by Message Archive Management (XEP-0313) . This contains collated fastenings if supported by the
After all entries required have been returned, the server then responds with an <iq/> result containing a
<fin/> element qualified by
urn:xmpp:inbox:1. This contains the RSM data, a total count of conversation
entries within the inbox, a count of conversations with unread messages, and a total count of unread messages.
Servers MUST track which instant messages sent to clients remain unread.
Let us assume a user has only three jids they have exchanged messages with. Asking for their inbox is simple:
The server responds with a list of conversations:
id of a conversation has changed, a client might fetch the missing messages and metadata by requesting the MAM archive
jid of the entry, and
after the previous known
id for the conversation.
After the list of conversations, the server completes its response with a the reply to the original IQ.
TODO - Hopefully roughly given by the examples.
This XEP requires no interaction with the Internet Assigned Numbers Authority (IANA) .
The author notes that this protocol is heavily based on the
mod_inbox system of MongooseIM. In addition, Kevin Smith and several others at the XMPP Summit 24 provided useful feedback which has shaped this specification.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <firstname.lastname@example.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <email@example.com>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/