In multi-device environments marking a chat as displayed on one device should mark that chat as displayed on all devices. Historically carbon copies (Message Carbons (XEP-0280) [1]) of the <displayed/> element of Displayed Markers (Displayed Markers (was: Chat Markers) (XEP-0333) [2]) have been used to achieve this effect. However this approach has a couple of downsides that this specification is trying eliminate:
This specification isolates the task of multi-device synchronization from providing information to the contact, while borrowing some of the semantics of Displayed Markers such as displayed refering to all messages up to this point.
Clients use items in a private PEP (Personal Eventing Protocol (XEP-0163) [3]) node called 'urn:xmpp:mds:displayed:0' to synchronize and persist the displayed state (See Best Practices for Persistent Storage of Private Data via Publish-Subscribe (XEP-0223) [4]). The item ID corresponds to the JID of the respective chat. For normal, 1:1 chats this SHOULD be the bare JID of the contact, for group chats this SHOULD be the bare JID of the room and for private messages in group chats the full JID of the participant.
The item contains a single <displayed/> element qualified by the 'xrn:xmpp:mds:displayed:0' namespace. The <displayed/> element MUST contain exactly one Unique and Stable Stanza IDs (XEP-0359) [5] <stanza-id/> element that corresponds to the stanza-id of the most recent, displayed message, in that particular chat.
Only messages received by the user (meaning sent by third parties such as a contact, a participant in a group chat, etc) SHOULD be flagged as 'displayed'. However since 'displayed' means all messages up to this point and the stanza-id of a message sent by the user indicates a valid point in the chat history, sent messages MAY be flagged as well.
Flagging a chat as displayed up to this point happens by publishing a PEP item with an id corresponding to the JID of the chat and a <displayed/> payload element into the 'urn:xmpp:mds:displayed:0' node.
For group chats the <stanza-id/> child of the <displayed/> element refers to the stanza-id injected by the room. For all other chats the stanza-id child refers to the stanza-id injected by the user’s server (the server hosting the user account).
The client MUST include appropriate publish-options in the publication, including, but not limited to, setting the access model to whitelist and the max-items to max.
A client interested in synchronizing the displayed state with other clients SHOULD include the 'urn:xmpp:mds:displayed:0+notify' feature in its Entity Capabilities (XEP-0115) [7], as per Personal Eventing Protocol (XEP-0163) [3] rules.
Upon bind and initial presence a client retrieves all items in the 'urn:xmpp:mds:displayed:0' node to learn what changes to the displayed state have occured while the client was offline.
A Displayed Markers (was: Chat Markers) (XEP-0333) [2] displayed marker refers to the message id set by the sender of the message whereas the displayed element defined in this specification refers to the stanza-id injected by the user’s server.
In the likely scenario that a client wishes to share the displayed state with their own devices and the sender of the message, a client SHOULD sent a Displayed Markers (was: Chat Markers) (XEP-0333) [2] displayed marker and ensure that the 'urn:xmpp:mds:displayed:0' node gets updated.
A Publish-Subscribe (XEP-0060) [8] item publication is a fairly verbose operation for something that is expected to happen rather frequently. Therfore this specification defines an optional way to combine the PEP node item update and the Displayed Marker in one simple message.
Server assisted displayed node updates are an optional feature a user’s server can provide. To signal support the server announces an Entity Capabilities (XEP-0115) [7] feature of 'urn:xmpp:mds:server-assist:0' on the account.
To update the displayed item in the 'urn:xmpp:mds:displayed:0' PEP node more efficiently a client MAY send a message with the 'to' attribute set to the item id (which is equivalent to the JID of the contact) and with a <displayed/> element qualified by the 'urn:xmpp:mds:displayed:0' namespace. The server MUST strip the <displayed/> element from the message and continue to process it normally. The server MUST publish a PEP item on the 'urn:xmpp:mds:displayed:0' node where the item id is taken from the 'to' attribute and the payload is the <displayed/> element. A client MUST NOT include the <displayed/> element qualified by the 'urn:xmpp:mds:displayed:0' namespace if the message would otherwise be empty. A client that wishes to update the device synchronized displayed state but not inform the sender of the message via Displayed Markers SHOULD use the regular PubSub publication process.
This specification comes with no accessibility considerations that go beyond what is required of any client (i.e. providing an accessible distinction between read and unread chats).
Implementing this specification gives the server the opportunity to perform activity tracking of a similiar scope than implementing Chat State Notifications (XEP-0085) [10] or Displayed Markers (was: Chat Markers) (XEP-0333) [2] would.
When using the server assist feature in conjunction with Displayed Markers (was: Chat Markers) (XEP-0333) [2] the Privacy Considerations of Display Markers apply.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA).
This specification introduces a distinct element to enable server assist instead of utilizing Displayed Markers (was: Chat Markers) (XEP-0333) [2] because Displayed Markers use the message id instead of stanza-ids. Translating between message id and stanza-id would require that the message (or parts of it) are archived on the server. Archiving should not be a requirement to offer server assist. (Especially since archived or not can depend on user settings.)
Server assist is not allowed in messages that would otherwise be empty. Overloading the semantic of sending a stanza to a third party entity solely to perform an action on the account that involves said third party is a dangerous example to set. (For example if server assit fails due to implementation errors a third party can be flooded with messages.) While stripping elements from stanzas is a common requirement on XMPP dropping entire stanzas without error is not.
This specification defines the following XML namespace:
REQUIRED for protocol specifications.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 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 HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
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 <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Errata can be sent to <editor@xmpp.org>.
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".
1. XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>.
2. XEP-0333: Displayed Markers (was: Chat Markers) <https://xmpp.org/extensions/xep-0333.html>.
3. XEP-0163: Personal Eventing Protocol <https://xmpp.org/extensions/xep-0163.html>.
4. XEP-0223: Best Practices for Persistent Storage of Private Data via Publish-Subscribe <https://xmpp.org/extensions/xep-0223.html>.
5. XEP-0359: Unique and Stable Stanza IDs <https://xmpp.org/extensions/xep-0359.html>.
6. XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>.
7. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.
8. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.
9. XEP-0409: IM Routing-NG <https://xmpp.org/extensions/xep-0409.html>.
10. XEP-0085: Chat State Notifications <https://xmpp.org/extensions/xep-0085.html>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
Split Business Rules into Server and Client sections.
Add Accessibility, Privacy and Design Considerations
First draft.
@report{gultsch2024mds, title = {Message Displayed Synchronization}, author = {Gultsch, Daniel}, type = {XEP}, number = {xxxx}, version = {0.0.3}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-xxxx.html}, date = {2024-02-21/2024-04-26}, }
END