1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-12-21 23:28:51 -05:00
This commit is contained in:
stpeter 2011-02-16 22:08:43 -07:00
parent e8d6d16fd7
commit 44795a37ca

View File

@ -11,6 +11,7 @@
&LEGALNOTICE;
<number>0184</number>
<status>Draft</status>
<interim/>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
@ -27,6 +28,12 @@
</schemaloc>
&stpeter;
&hildjj;
<revision>
<version>1.2rc1</version>
<date>2011-02-16</date>
<initials>psa</initials>
<remark><p>Clarified terminology and several points of implementation.</p></remark>
</revision>
<revision>
<version>1.1</version>
<date>2010-03-31</date>
@ -99,32 +106,44 @@
</ol>
</section1>
<section1 topic='Terminology' anchor='terms'>
<p>The term "content message" refers to the stanza for which the original sender would like to receive a receipt.</p>
<p>The term "ack message" refers to the stanza by which the recipient acknowledges receipt of the content message.</p>
</section1>
<section1 topic='What This Protocol Provides' anchor='what'>
<p>This document defines a protocol that enables a sender to ask the recipient to return a receipt for a message. Although the return of a message receipt lets the sender know that the message has been delivered, there are many reasons why the sender might not receive a receipt immediately or at all, including but not limited to the following:</p>
<p>This document defines a protocol that enables a sender to ask the recipient to acknowledge receipt of a content message by returning an ack message. Although the return of an ack message lets the sender know that the content message has been delivered, there are many reasons why the sender might not receive an ack message immediately or at all, including but not limited to the following:</p>
<ul>
<li>The sender addressed the message to the recipient's bare JID &LOCALBARE; and therefore does not know if the recipient even supports message receipts.</li>
<li>The sender has not bothered to determine whether the recipient supports message receipts.</li>
<li>The recipient (or the particular intended resource to which the sender addressed the message) does not in fact support message receipts.</li>
<li>The intended resource supports message receipts but the recipient's server delivers the message to another resource that does not support message receipts.</li>
<li>The recipient's client receives the message but experiences a malfunction before generating a receipt.</li>
<li>The recipient returns a receipt but the receipt is lost on the way back from the recipient to the sender (e.g., because of connectivity issues or software failures at any hop).</li>
<li>The recipient simply does not wish to return a receipt for the sent message.</li>
<li>The sender addressed the content message to the recipient's bare JID &LOCALBARE; and therefore does not know if the recipient even supports the Message Receipts protocol.</li>
<li>The sender has not bothered to determine whether the recipient supports the Message Receipts protocol.</li>
<li>The recipient (or the particular intended resource to which the sender addressed the content message) does not in fact support the Message Receipts protocol.</li>
<li>The intended resource supports the Message Receipts protocol but the recipient's server delivers the content message to another resource that does not support the Message Receipts protocol.</li>
<li>The recipient's client receives the content message but experiences a malfunction before generating an ack message.</li>
<li>The recipient returns an ack message but the ack message is lost on the way back from the recipient to the sender (e.g., because of connectivity issues or software failures at any hop).</li>
<li>The recipient simply does not wish to return a receipt for the content message.</li>
</ul>
<p>Because of these significant limitations, this protocol does not provide complete or even partial reliability or guaranteed delivery. Therefore, the sender SHOULD NOT impute any meaning to the lack of a receipt unless it has established with the recipient that receipt requests will be honored; however, methods for doing so are out of scope for this specification and it is NOT RECOMMENDED to take any particular action (such as resending a message) without such methods. <note>This protocol merely provides a building block that could be used in conjunction with other protocols to asymptotically approach the eventual goal of messaging reliability and guaranteed delivery.</note></p>
<p>Because of these significant limitations, this protocol does not provide complete or even partial reliability or guaranteed delivery. Therefore, the sender SHOULD NOT impute any meaning to the fact that it has not received an ack message, unless it has established with the recipient that receipt requests will be honored; however, methods for doing so are out of scope for this specification and it is NOT RECOMMENDED to take any particular action (such as resending the content message) without such methods. <note>This protocol merely provides a building block that could be used in conjunction with other protocols to asymptotically approach the eventual goal of messaging reliability and guaranteed delivery.</note></p>
<p>Because it is possible for a given content message to be delivered to multiple XMPP resources controlled by the recipient, the sender of the content message needs to be prepared to receive multiple ack messages.</p>
</section1>
<section1 topic='When to Request Receipts' anchor='when'>
<p>A sender <em>could</em> request receipts on any non-error message (chat, groupchat, headline, or normal) no matter if the recipient's address is a bare JID &LOCALBARE; or a full JID &LOCALFULL;. Whether it is <em>appropriate</em> or <em>advisable</em> to do so it another question. This section provides recommendations about when and when not to request receipts, and what results to expect in each scenario.</p>
<p>A sender <em>could</em> request receipts on any non-error content message (chat, groupchat, headline, or normal) no matter if the recipient's address is a bare JID &LOCALBARE; or a full JID &LOCALFULL;. Whether it is <em>appropriate</em> or <em>advisable</em> to do so it another question. This section provides recommendations about when and when not to request receipts, and what results to expect in each scenario.</p>
<section2 topic='Bare JID' anchor='when-bare'>
<p>If the sender knows only the recipient's bare JID, it cannot cannot determine (via disco or caps) whether the intended recipient supports message receipts. In this case, the sender MAY request a receipt when sending a message of type "chat", "headline", or "normal" to the recipient's bare JID. However, the sender MUST NOT depend on receiving a receipt.</p>
<p>If the sender knows only the recipient's bare JID, it cannot cannot determine (via &xep0030; or &xep0115;) whether the intended recipient supports the Message Receipts protoocl. In this case, the sender MAY request a receipt when sending a content message of type "chat", "headline", or "normal" to the recipient's bare JID. However, the sender MUST NOT depend on receiving an ack message in reply.</p>
</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 disco or caps) whether the client at that full JID supports message receipts before attempting to request receipts.</p>
<p>If the sender determines that the recipient's client does not support message receipts then it SHOULD NOT request a receipt when sending a message to that full JID and MUST NOT depend on receiving a receipt.</p>
<p>If the sender determines that the recipient's client supports message receipts then it MAY request a receipt when sending a message of type "chat", "headline", or "normal" to that full JID. However, even in this case the sender SHOULD NOT depend on receiving a receipt.</p>
<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 Message Receipts protocol before attempting to request receipts.</p>
<p>If the sender determines that the recipient's client does not support the Message Receipts protocol then it SHOULD NOT request a receipt when sending a content message to that full JID and MUST NOT depend on receiving an ack message.</p>
<p>If the sender determines that the recipient's client supports the Message Receipts protocol then it MAY request a receipt when sending a content message of type "chat", "headline", or "normal" to that full JID. However, even in this case the sender SHOULD NOT depend on receiving an ack message.</p>
</section2>
<section2 topic='Groupchat' anchor='when-groupchat'>
<p>It is NOT RECOMMENDED to request a receipt when sending a message of type "groupchat" in a &xep0045; room because the logic for determining when a message is truly "received" by all of the room occupants is complex and because the sender would receive one receipt from each occupant of the room, thus significantly increasing the number of messages sent through the room.</p>
<p>It is NOT RECOMMENDED to request a receipt when sending a content message of type "groupchat" in a &xep0045; room because the logic for determining when a content message is truly "received" by all of the room occupants is complex, and because the sender would receive one ack message from each occupant of the room, thus significantly increasing the number of stanzas sent through the room.</p>
</section2>
<section2 topic='Ack Messages' anchor='when-ack'>
<p>To prevent looping, an entity MUST NOT include a receipt request (i.e., the &lt;request/&gt; element) in an ack message (i.e., a message stanza that includes the &lt;received/&gt; element).</p>
</section2>
<section2 topic='Archived Messages' anchor='when-archive'>
<p>An entity MUST NOT send an ack message when a user views messages that have been archived or stored on the client or the server (e.g., via &xep0136;), only when first receiving the message.</p>
</section2>
</section1>
@ -148,19 +167,19 @@
</query>
</iq>
]]></example>
<p>Support can also be determined via &xep0115; a.k.a. "caps".</p>
<p>Support can also be determined via &xep0115;, a.k.a. "caps".</p>
</section1>
<section1 topic='Protocol Format' anchor='format'>
<p>In order to make it possible for senders to request and for recipients to generate message receipts, we define a dedicated protocol extension qualified by the 'urn:xmpp:receipts' namespace.</p>
<p>There are two allowable elements in this namespace:</p>
<ul>
<li>&lt;request/&gt; -- included by a sending entity that wishes to know if the message has been received.</li>
<li>&lt;received/&gt; -- included by a receiving entity that wishes to inform the sending entity that the message has been received.</li>
<li>&lt;request/&gt; -- included in a content message by a sending entity that wishes to know if the content message has been received.</li>
<li>&lt;received/&gt; -- included in an ack message by a receiving entity that wishes to inform the sending entity that the content message has been received.</li>
</ul>
<p>Specifically, the receiving entity shall return a &lt;received/&gt; notice if it has received and processed the message. The term "processed" is understood to include presentation to a human user if appropriate or any other application-specific client-side processing, including generation of an error response if the application determines that the message contents cannot be handled.</p>
<p>The following is an example of a message that includes a request for return receipt.</p>
<example caption='A message with receipt requested'><![CDATA[
<p>Specifically, the receiving entity shall return an ack message containing the &lt;received/&gt; extensino if it has received and processed the content message. The term "processed" is to be understood as including presentation to a human user if appropriate or any other application-specific client-side processing, including generation of an error response if the application determines that the content message cannot be handled.</p>
<p>The following is an example of a content message that includes a request for return receipt.</p>
<example caption='A content message with receipt requested'><![CDATA[
<message
from='northumberland@shakespeare.lit/westminster'
id='richard2-4.1.247'
@ -169,8 +188,8 @@
<request xmlns='urn:xmpp:receipts'/>
</message>
]]></example>
<p class='box'>Note: A sender MUST include an 'id' attribute on every message that requests a receipt, so that the sender can properly track the receipt.</p>
<p>The recipient shall generate a receipt if and only if it supports the protocol defined herein and it is configured to return receipts, either globally or for this recipient (otherwise it MUST NOT return a receipt and SHOULD NOT return an error).</p>
<p class='box'>Note: A sender MUST include an 'id' attribute on every content message that requests a receipt, so that the sender can properly track ack messages.</p>
<p>The recipient shall generate an ack message if and only if it supports the protocol defined herein and it is configured to return receipts, either globally or for this recipient (otherwise it MUST NOT return a receipt and SHOULD NOT return an error).</p>
<example caption='A message receipt'><![CDATA[
<message
from='kingrichard@royalty.england.lit/throne'
@ -179,7 +198,7 @@
<received xmlns='urn:xmpp:receipts' id='richard2-4.1.247'/>
</message>
]]></example>
<p>The &lt;received/&gt; element SHOULD be the only child of the &MESSAGE; stanza and SHOULD include an 'id' attribute that echoes the 'id' attribute of the sent message.</p>
<p>When the recipient sends an ack message, it SHOULD ensure that the message stanza contains only one child element, namely the &lt;received/&gt; element qualified by the 'urn:xmpp:receipts' namespace. In addition, it SHOULD include an 'id' attribute that echoes the 'id' attribute of the content message. 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>
</section1>
<section1 topic='Security Considerations' anchor='security'>
@ -236,7 +255,7 @@
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Joe Kemp, Kevin Smith, Remko Tronçon, and Matthew Wild for their input.</p>
<p>Thanks to Steven te Brinke, Bruce Campbell, Joe Kemp, Kevin Smith, Remko Tronçon, Matthew Wild, and Kurt Zeilenga for their input.</p>
</section1>
</xep>