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. The server
responds with a sequence of <message/> stanzas, each containing an
<entry/> element qualified by the
urn:xmpp:inbox:0 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.
marked- a boolean indicating that a client has explicitly marked the conversation for some reason.
<entry/> element contains 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:0. 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.
Any counter of unread SHOULD be accurate, however client implementors please note that due to heuristics involved and other issues these counters can be inaccurate at times.
A client MAY at any time set a conversation as marked by sending an <iq/> of type "set" containing something or other. This causes the server to set the "marked" flag on a conversation. A client SHOULD display a marked conversation in the same way as an unread conversation, and explicitly removed the marked flag when the conversation is considered re-read.
Removing a marked flag, even when the conversation is not currently marked, causes the unread counter for that conversation to be set to zero.
Servers MUST track which instant messages sent to clients remain unread.
Let us assume a user has only two contacts they have exchanges messages with, and a single chatroom. Asking for their inbox is simple:
The server responds with a list of conversations:
After the list of messages, 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 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".
7. 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/