1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-25 10:42:19 -05:00
xeps/xep-0333.xml

370 lines
16 KiB
XML
Raw Normal View History

2013-05-28 16:33:56 -04:00
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Chat Markers</title>
2013-06-24 16:03:12 -04:00
<abstract>This specification describes a solution of marking the last received, displayed and acknowledged message in a chat.</abstract>
2013-07-11 13:03:19 -04:00
&LEGALNOTICE;
2013-07-11 12:59:11 -04:00
<number>0333</number>
<status>Experimental</status>
<lastcall>2017-03-01</lastcall>
<lastcall>2017-02-22</lastcall>
2017-01-28 12:12:26 -05:00
<lastcall>2017-02-11</lastcall>
2013-05-28 16:33:56 -04:00
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0001</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Spencer</firstname>
<surname>MacDonald</surname>
<email>im@spencermacdonald.com</email>
<jid>im@spencermacdonald.com</jid>
</author>
<revision>
<version>0.4</version>
<date>2020-04-15</date>
<initials>mw</initials>
<remark>Add notes about usage within MUCs.</remark>
</revision>
2017-09-11 11:49:11 -04:00
<revision>
<version>0.3</version>
<date>2017-09-11</date>
<initials>XEP Editor (jwi)</initials>
<remark>Defer due to lack of activity.</remark>
</revision>
2015-10-26 03:01:20 -04:00
<revision>
<version>0.2.1</version>
<date>2015-10-28</date>
<initials>XEP Editor (mam)</initials>
<remark><p>Fixing typo ("cannot" repeated twice) (JC Brand).</p></remark>
</revision>
2013-09-05 12:28:13 -04:00
<revision>
<version>0.2</version>
<date>2013-09-05</date>
<initials>sdm</initials>
<remark><p>Moved Thread outside of the Chat Marker.</p></remark>
</revision>
2013-07-11 12:59:11 -04:00
<revision>
<version>0.1</version>
<date>2013-07-11</date>
<initials>psa</initials>
<remark><p>Initial published version approved by the XMPP Council.</p></remark>
</revision>
2013-07-09 11:28:53 -04:00
<revision>
<version>0.0.4</version>
<date>2013-07-06</date>
<initials>sdm</initials>
<remark>
<p>Noted that Chat Markers is a heuristic solution.</p>
<p>Added markable element.</p>
</remark>
</revision>
2013-06-24 16:03:12 -04:00
<revision>
<version>0.0.3</version>
<date>2013-06-20</date>
<initials>sdm</initials>
<remark>
<p>Changed read Chat Marker to displayed.</p>
<p>Removed stamp from Chat Marker.</p>
<p>Added thread to Chat Marker.</p>
<p>Changed namespace to allow for versioning.</p>
</remark>
</revision>
2013-06-12 13:33:15 -04:00
<revision>
<version>0.0.2</version>
<date>2013-06-11</date>
<initials>sdm</initials>
<remark><p>Change to a message based protocol.</p></remark>
</revision>
2013-05-28 16:33:56 -04:00
<revision>
<version>0.0.1</version>
<date>2013-05-24</date>
<initials>sdm</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>The concept of delivery and read receipts has been popularised by other messaging services such as iMessage, Google Hangouts and Blackberry Messenger.
These services provide a visual indication of when a message has been delivered to any of the recipients resources and (optionally) when it has been read.
These visual indications (referred to herein as "Chat Markers") are synced between all of the sender's
and recipient's resources automatically, so the state of a chat is always consistent.
2013-06-24 16:03:12 -04:00
If one or more of the resources is not connected, it can fetch Chat Markers from the Message Archive upon reconnecting.</p>
<p>&xep0184; currently provides delivery receipts on a per message basis,
but it does not provide any mechanism for the user to indicate that they have read or acknowledged the message.
2013-06-24 16:03:12 -04:00
As delivery receipts are sent on a per message basis it would require multiple messages to "sync up" up delivery receipts between resources.</p>
<p>Moreover by using &xep0085; you could infer that a message has been read by the recipient, if they become active at any point after the message has been delivered, but again it would require multiple messages to "sync up" chat states between resources.</p>
2013-06-12 13:33:15 -04:00
<p>This XEP outlines an efficient message based protocol to provide this functionally using Chat Markers.</p>
2013-07-09 11:28:53 -04:00
<p class='box'><em>Note: Chat Markers do not mark each individual message, nor do they assume a reliable transport. This means that Chat Markers can only provide a heuristic solution, but this is often satisfactory for the majority of use cases.</em></p>
2013-05-28 16:33:56 -04:00
</section1>
<section1 topic='Terminology' anchor='terms'>
2013-06-24 16:03:12 -04:00
<p>The term "active chat" refers to a chat that a user is currently active in. See &xep0085;.</p>
<p>The term "system notification" refers to a notification (typically a preview) that is displayed separately to a Chat.</p>
<p>The term "read" in the context of iMessage, Google Hangouts and Blackberry Messenger, directly maps to the displayed element in the Chat Marker namespace.</p>
2013-07-09 11:28:53 -04:00
<p>The term "markable message" refers to the stanza for which the original sender would like to receive a Chat Marker.</p>
<p>The term "Chat Marker" refers to the stanza by which the recipient replies to a "markable message" with a marker.</p>
2013-05-28 16:33:56 -04:00
</section1>
2013-07-09 11:28:53 -04:00
2013-05-28 16:33:56 -04:00
<section1 topic='Requirements' anchor='reqs'>
<p>This document addresses the following requirements:</p>
<ol>
2013-07-09 11:28:53 -04:00
<li>Enable a client to mark a message as markable.</li>
2013-06-24 16:03:12 -04:00
<li>Enable a client to mark the last received message in a chat.</li>
<li>Enable a client to mark the last displayed message in a chat.</li>
<li>Enable a client to mark the last acknowledged message in a chat.</li>
<li>Enable a client to fetch and set Chat Markers regardless of wether the other users in a chat are online.</li>
2013-05-28 16:33:56 -04:00
</ol>
</section1>
2013-07-09 11:28:53 -04:00
<section1 topic='Determining support' anchor='disco'>
<p>If an entity supports the Chat Markers protocol, it MUST report that by including a &xep0030;
feature of "urn:xmpp:chat-markers:0" in response to disco#info requests:</p>
<example caption='Client queries for server features'>
<![CDATA[
<iq type='get' id='disco1' to='capulet.lit' from='juliet@capulet.lit/balcony'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]>
</example>
<example caption='Entity responds with features'>
<![CDATA[
<iq type='result' id='disco1' from='capulet.lit' to='juliet@capulet.lit/balcony'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:chat-markers:0'/>
...
</query>
</iq>
]]>
</example>
<p>Support can also be determined via &xep0115;, a.k.a. "caps".</p>
</section1>
<section1 topic='When to send Chat Markers and markable messages' anchor='when'>
<section2 topic='Bare JID' anchor='when-bare'>
2015-10-26 03:01:20 -04:00
<p>If the sender knows only the recipient's bare JID, it cannot determine (via &xep0030; or &xep0115;) whether the intended recipient supports the Chat Markers protocol. In this case, the sender MAY send a Chat Marker or markable message.</p>
2013-07-09 11:28:53 -04:00
</section2>
<section2 topic='Full JID' anchor='when-full'>
<p>If the sender knows a full JID for the recipient (e.g., via presence), it SHOULD attempt to determine (via service disco or entity capabilities) whether the client at that full JID supports the Chat Markers protocol before attempting to send a Chat Marker or markable message.</p>
<p>If the sender determines that the recipient's client does not support the Chat Markers protocol then it SHOULD NOT send Chat Markers or markable messages.</p>
<p>If the sender determines that the recipient's client supports the Chat Markers protocol then it MAY send a Chat Marker or markable message to that full JID.</p>
</section2>
<section2 topic='Chat Marker' anchor='when-chat-marker'>
<p>To prevent looping, an entity MUST NOT send a Chat Marker to mark up to a Chat Marker.</p>
2013-07-09 11:28:53 -04:00
</section2>
</section1>
<section1 topic='Protocol Format' anchor='format'>
2013-06-24 16:03:12 -04:00
<p>Chat Markers use a dedicated protocol extension qualified by the 'urn:xmpp:chat-markers:0' namespace.</p>
2013-09-05 12:28:13 -04:00
<p>There are 4 allowable elements in the namespace, the first 'markable' indicates that a message can be marked with a Chat Marker and is therefore a "markable message".</p>
2013-07-09 11:28:53 -04:00
<p>The 3 other allowable elements in this namespace are used to mark a message (in order of significance):</p>
2013-05-28 16:33:56 -04:00
<ul>
2013-06-24 16:03:12 -04:00
<li>received -- the message has been received by a client.</li>
<li>displayed -- the message has been displayed to a user in a active chat and not in a system notification.</li>
<li>acknowledged -- the message has been acknowledged by some user interaction e.g. pressing an acknowledgement button.</li>
2013-05-28 16:33:56 -04:00
</ul>
2013-06-12 13:33:15 -04:00
<p>The Chat Marker MUST have an 'id' which is the 'id' of the message being marked.</p>
2013-09-05 12:28:13 -04:00
<p>The Chat Marker message stanza MUST have a 'thread' child element if the message has been received, displayed or acknowledged in the context of a thread.</p>
2013-06-24 16:03:12 -04:00
<p>A Chat Marker Indicates that all messages up to and including that message 'id' have been marked. If a thread is supplied, a Chat Marker is only valid in the context of that thread.</p>
2013-07-09 11:28:53 -04:00
<example caption='Example Content Message with a markable Chat Marker'>
<![CDATA[
2013-07-09 11:28:53 -04:00
<message
from='northumberland@shakespeare.lit/westminster'
id='message-1'
2016-04-25 19:55:49 -04:00
to='kingrichard@royalty.england.lit/throne'>
2013-07-09 11:28:53 -04:00
<thread>sleeping</thread>
2013-09-05 12:28:13 -04:00
<body>My lord, dispatch; read o'er these articles.</body>
2013-07-09 11:28:53 -04:00
<markable xmlns='urn:xmpp:chat-markers:0'/>
</message>
]]>
</example>
<p class='box'>Note: A sender MUST include an 'id' attribute on every markable message.</p>
<p>If recipient does not support the Chat Markers protocol it SHOULD NOT return an error.</p>
<example caption='Example Message marked with a recieved Chat Marker'>
<![CDATA[
2013-06-12 13:33:15 -04:00
<message
from='kingrichard@royalty.england.lit/throne'
2013-07-09 11:28:53 -04:00
id='message-2'
2013-06-12 13:33:15 -04:00
to='northumberland@shakespeare.lit/westminster'>
2013-09-05 12:28:13 -04:00
<thread>sleeping</thread>
<received xmlns='urn:xmpp:chat-markers:0'
2013-09-05 12:28:13 -04:00
id='message-1'/>
2013-06-12 13:33:15 -04:00
</message>
2013-06-24 16:03:12 -04:00
]]>
2013-07-09 11:28:53 -04:00
</example>
2013-09-05 12:28:13 -04:00
<p>When the recipient sends a Chat Marker, it SHOULD ensure that the message stanza contains only the Chat Marker child element and optionally (when appropriate) a thread child element. Naturally, intermediate entities might add other extension elements to the message when routing or delivering the receipt message, e.g., a &lt;delay/&gt; element as specified in &xep0203;.</p>
2013-06-12 13:33:15 -04:00
</section1>
2013-05-28 16:33:56 -04:00
2013-06-12 13:33:15 -04:00
<section1 topic='Requirements' anchor='requirements'>
<p>Clients SHOULD use &xep0280; to support multiple online resources.</p>
2013-09-05 12:28:13 -04:00
<p>Clients SHOULD use &xep0136; or &xep0313; to support offline updating of Chat Markers. Chat Markers SHOULD be archived, so they can be fetched and set regardless of whether the other users in a chat are online.</p>
2013-06-24 16:03:12 -04:00
<p>Messages MUST have an 'id' to use Chat Markers.</p>
2013-07-09 11:28:53 -04:00
<p>Messages MUST include the 'markable' element to use Chat Markers.</p>
<p>Chat Markers MUST only move forward. If a Chat Marker is received for an earlier message than the current Chat Marker, it MUST be ignored by the client.
2013-06-24 16:03:12 -04:00
</p>
2013-07-09 11:28:53 -04:00
<p>Chat Markers for unknown messages MUST be ignored by the client. A client MAY store the Chat Marker incase the associated message is retrieved later.
</p>
2013-05-28 16:33:56 -04:00
</section1>
<section1 topic='Business Rules' anchor='rules'>
2013-06-12 13:33:15 -04:00
<section2 topic='Optimizations' anchor='chatstates'>
<p>Less Significant Chat Markers SHOULD only be sent if they are later than the more significant Chat Marker i.e. if a Message has been marked as displayed,
2013-06-24 16:03:12 -04:00
a received Chat Marker should only be sent if it has a later timestamp than the displayed Chat Marker.</p>
<p>To avoid sending redundant Chat Markers while retrieving archived messages, Chat Markers SHOULD only be sent after retrieving the most recent message for a chat.</p>
2013-07-09 11:28:53 -04:00
<p>Only Messages that can be displayed in a chat SHOULD be markable.</p>
2013-06-24 16:03:12 -04:00
</section2>
<section2 topic='Never Auto Acknowledge' anchor='never-auto-acknowledge'>
<p>Clients MUST NOT mark a message as acknowledged without any user interaction.</p>
</section2>
<section2 topic='Marking Sent Messages' anchor='marking-sent-messages'>
2013-07-09 11:28:53 -04:00
<p>Clients MAY mark a sent or received message, as Chat Markers are inclusive of of both previously sent and received messages.</p>
2013-06-12 13:33:15 -04:00
</section2>
<section2 topic='Interaction with Delivery Receipts' anchor='receipts'>
2013-07-09 11:28:53 -04:00
<p>Chat Markers MAY be used alongside Delivery Receipts.</p>
2013-05-28 16:33:56 -04:00
</section2>
<section2 topic='Interaction with Chat States' anchor='chatstates'>
2013-06-24 16:03:12 -04:00
<p>Chat Markers MAY be used alongside Chat States.</p>
2013-05-28 16:33:56 -04:00
</section2>
<section2 topic='Usage within MUC' anchor='rules-muc'>
<p>Markers may be used within a MUC to indicate read status of each occupant.</p>
<p>Within the context of a MUC messages are relayed through the MUC's own JID. In a
MUC that preserves the 'id' attribute chosen by the sender of the message this
'id' attribute cannot be considered unique, as it may be unintentionally or
even maliciously reused by another MUC occupant.</p>
<p>Therefore, if a MUC announces support for &xep0359; then clients MUST always use
the MUC-assigned id for Chat Markers. The id will be contained in a &lt;stanza-id/&gt;
element inserted into the stanza with a 'by' attribute matching the MUC's own JID.</p>
<p>As per XEP-0359 security considerations, if XEP-0359 support is not announced on the
MUC room's JID then &lt;stanza-id/&gt; elements with a 'by' attribute that match the
MUC's JID should be considered spoofed and MUST be ignored.</p>
<example caption='Example MUC message with a markable Chat Marker'>
<![CDATA[
<message
from='coven@chat.shakespeare.lit/firstwitch'
to='coven@chat.shakespeare.lit'
id='message-1'
type='groupchat'>
<thread>Act IV, Scene I</thread>
<body>Thrice the brinded cat hath mew'd.</body>
<markable xmlns='urn:xmpp:chat-markers:0' />
<stanza-id xmlns='urn:xmpp:sid:0' by='coven@chat.shakespeare.lit' id='39K7ZYIp' />
</message>
]]>
</example>
<example caption='Example marker response to a markable MUC message'>
<![CDATA[
<message
from='coven@chat.shakespeare.lit/secondwitch'
to='coven@chat.shakespeare.lit'
id='message-2'
type='groupchat'>
<thread>Act IV, Scene I</thread>
<displayed xmlns='urn:xmpp:chat-markers:0'
id='39K7ZYIp'/>
</message>
]]>
</example>
</section2>
2013-05-28 16:33:56 -04:00
</section1>
<section1 topic='Security Considerations' anchor='security'>
2013-06-24 16:03:12 -04:00
<p>A user may not wish to disclose that they have received, displayed or acknowledge a message.</p>
<p>It is possible for a sender to leak its presence when updating Chat Markers;
2013-06-24 16:03:12 -04:00
therefore, a sender SHOULD NOT send Chat Markers to recipients who are not otherwise authorized to view its presence.</p>
2013-05-28 16:33:56 -04:00
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with the Internet Assigned Numbers Authority (IANA).</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p>
<ul>
2013-06-24 16:03:12 -04:00
<li>'urn:xmpp:chat-markers:0'</li>
2013-05-28 16:33:56 -04:00
</ul>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
2013-06-24 16:03:12 -04:00
<code>
<![CDATA[
2013-05-28 16:33:56 -04:00
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="urn:xmpp:chat-markers:0"
2013-05-28 16:33:56 -04:00
xmlns:xs="http://www.w3.org/2001/XMLSchema">
2013-05-28 16:33:56 -04:00
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
2013-09-05 12:28:13 -04:00
XEP-0333: http://xmpp.org/extensions/xep-0333.html
2013-05-28 16:33:56 -04:00
</xs:documentation>
</xs:annotation>
2013-07-09 11:28:53 -04:00
<xs:element name="markable">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
2013-05-28 16:33:56 -04:00
2013-06-12 13:33:15 -04:00
<xs:element name="received">
2013-05-28 16:33:56 -04:00
<xs:complexType>
2013-06-12 13:33:15 -04:00
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="id"/>
</xs:extension>
</xs:simpleContent>
2013-05-28 16:33:56 -04:00
</xs:complexType>
</xs:element>
2013-06-24 16:03:12 -04:00
<xs:element name="displayed">
2013-06-12 13:33:15 -04:00
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="id"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
2013-06-12 13:33:15 -04:00
<xs:element name="acknowledged">
2013-05-28 16:33:56 -04:00
<xs:complexType>
2013-06-12 13:33:15 -04:00
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="id"/>
</xs:extension>
</xs:simpleContent>
2013-05-28 16:33:56 -04:00
</xs:complexType>
</xs:element>
2013-05-28 16:33:56 -04:00
</xs:schema>
2013-06-24 16:03:12 -04:00
]]>
</code>
2013-05-28 16:33:56 -04:00
</section1>
</xep>