1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-30 21:22:15 -05:00

0.14 final

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@266 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2006-12-12 21:52:16 +00:00
parent 6a71aae1ed
commit c47e7bbd62

View File

@ -27,9 +27,9 @@
&stpeter; &stpeter;
<revision> <revision>
<version>0.14</version> <version>0.14</version>
<date>2006-12-11</date> <date>2006-12-12</date>
<initials>psa/ip</initials> <initials>psa/ip</initials>
<remark><p>Specified state chart; added optional presence sharing; harmonized treatment of renegotiation; changed otr, xhtml-im, and chatstates fields back to boolean; per XEP-0053, specified use of provisional namespace until spec advances to Draft.</p></remark> <remark><p>Specified state chart; added optional presence sharing; harmonized treatment of renegotiation; per XEP-0053, specified use of provisional namespace until spec advances to Draft.</p></remark>
</revision> </revision>
<revision> <revision>
<version>0.13</version> <version>0.13</version>
@ -126,6 +126,15 @@
</ul> </ul>
<p>This proposal defines best practices for such a negotiation, re-using the protocol defined in &xep0020;.</p> <p>This proposal defines best practices for such a negotiation, re-using the protocol defined in &xep0020;.</p>
</section1> </section1>
<section1 topic='Requirements' anchor='req'>
<p>The specification addresses the following use cases:</p>
<ul>
<li>Negotiating a new chat session</li>
<li>Moving an existing chat session from one resource to another</li>
<li>Renegotiating an existing chat session</li>
<li>Terminating an existing chat session</li>
</ul>
</section1>
<section1 topic='State Chart' anchor='statechart'> <section1 topic='State Chart' anchor='statechart'>
<p>The following figure attempts to capture the state transitions in visual form.</p> <p>The following figure attempts to capture the state transitions in visual form.</p>
<code> <code>
@ -166,7 +175,7 @@ PENDING o---------------+
<p>[8] A chat session is terminated when either party sends a message containing a data form of type "submit" with a "terminate" field whose value is "1" or "true".</p> <p>[8] A chat session is terminated when either party sends a message containing a data form of type "submit" with a "terminate" field whose value is "1" or "true".</p>
</section1> </section1>
<section1 topic='Negotiating a New Chat Session' anchor='new'> <section1 topic='Negotiating a New Chat Session' anchor='new'>
<section2 topic='Initiating a Chat' anchor='new-initiate'> <section2 topic='Initiating a Chat Session' anchor='new-initiate'>
<p>In order to initiate a negotiated chat session, the initiating party ("user") sends a &MESSAGE; <note>The &MESSAGE; stanza is used because the user does not necessarily know which of the contact's resources is most available (or indeed if the contact is online).</note> stanza to the receiving party ("contact") containing a &lt;feature/&gt; child qualified by the 'http://jabber.org/protocol/feature-neg' namespace. The &MESSAGE; stanza MUST NOT contain a &BODY; child element (as specified in &rfc3921;). The &MESSAGE; stanza type SHOULD be "normal" (either explicitly or by non-inclusion of the 'type' attribute). The stanza MUST contain a &THREAD; element for tracking purposes (where the newly-generated ThreadID is unique to the proposed session). The data form MUST contain a hidden FORM_TYPE field whose value is "http://www.xmpp.org/extensions/xep-0155.html#ns" and MUST contain a boolean field named "accept". &BOOLEANNOTE; The inclusion of "otr", "disclosure" and "security" fields is also RECOMMENDED. Note: The options within any 'list-single' fields SHOULD appear in order of preference.</p> <p>In order to initiate a negotiated chat session, the initiating party ("user") sends a &MESSAGE; <note>The &MESSAGE; stanza is used because the user does not necessarily know which of the contact's resources is most available (or indeed if the contact is online).</note> stanza to the receiving party ("contact") containing a &lt;feature/&gt; child qualified by the 'http://jabber.org/protocol/feature-neg' namespace. The &MESSAGE; stanza MUST NOT contain a &BODY; child element (as specified in &rfc3921;). The &MESSAGE; stanza type SHOULD be "normal" (either explicitly or by non-inclusion of the 'type' attribute). The stanza MUST contain a &THREAD; element for tracking purposes (where the newly-generated ThreadID is unique to the proposed session). The data form MUST contain a hidden FORM_TYPE field whose value is "http://www.xmpp.org/extensions/xep-0155.html#ns" and MUST contain a boolean field named "accept". &BOOLEANNOTE; The inclusion of "otr", "disclosure" and "security" fields is also RECOMMENDED. Note: The options within any 'list-single' fields SHOULD appear in order of preference.</p>
<p>Note: Chat sessions may be conducted between entities who are never online at the same time. However, if the user is interested only in an <em>immediate</em> chat session then the user SHOULD instruct the contact's server not to store the message for later delivery (see &xep0160;) using the &xep0079; protocol.</p> <p>Note: Chat sessions may be conducted between entities who are never online at the same time. However, if the user is interested only in an <em>immediate</em> chat session then the user SHOULD instruct the contact's server not to store the message for later delivery (see &xep0160;) using the &xep0079; protocol.</p>
<p>In the following example of a negotiation request, Romeo requests a chat with Juliet and also queries her regarding whether she wants to enable all message logging (see &xep0136;) <note>A client MUST NOT set the 'otr' field to 'true' unless it has confirmed that its server will allow it to switch off Automated Archiving (see <cite>Message Archiving</cite>).</note> and support the &xep0071; and &xep0085; extensions during this chat session. He asks Juliet's client if it is prepared to make a (legally binding) guarantee that it does not intentionally implement any feature (not even a disabled feature) that might disclose the content of the chat, any associated (decryption) keys or his identity to any third-party (see <cite>Encrypted Session Negotiation</cite>). He also requires that they are both connected securely to their servers, and asks which language she prefers amoungst those he can write. (Note: These fields are examples only; a full set of chat session negotiation parameters will be registered as described in the <link url='#registrar'>XMPP Registrar Considerations</link> section of this document.)</p> <p>In the following example of a negotiation request, Romeo requests a chat with Juliet and also queries her regarding whether she wants to enable all message logging (see &xep0136;) <note>A client MUST NOT set the 'otr' field to 'true' unless it has confirmed that its server will allow it to switch off Automated Archiving (see <cite>Message Archiving</cite>).</note> and support the &xep0071; and &xep0085; extensions during this chat session. He asks Juliet's client if it is prepared to make a (legally binding) guarantee that it does not intentionally implement any feature (not even a disabled feature) that might disclose the content of the chat, any associated (decryption) keys or his identity to any third-party (see <cite>Encrypted Session Negotiation</cite>). He also requires that they are both connected securely to their servers, and asks which language she prefers amoungst those he can write. (Note: These fields are examples only; a full set of chat session negotiation parameters will be registered as described in the <link url='#registrar'>XMPP Registrar Considerations</link> section of this document.)</p>
@ -185,7 +194,7 @@ PENDING o---------------+
<value>true</value> <value>true</value>
<required/> <required/>
</field> </field>
<field label='Off-The-Record?' type='boolean' var='otr'> <field label='Off-The-Record?' type='list-single' var='otr'>
<value>0</value> <value>0</value>
<option label='Allow message logging'> <option label='Allow message logging'>
<value>0</value> <value>0</value>
@ -209,21 +218,21 @@ PENDING o---------------+
<required/> <required/>
</field> </field>
<field label='XHTML formatting?' <field label='XHTML formatting?'
type='boolean' type='list-single'
var='http://jabber.org/protocol/xhtml-im'> var='http://jabber.org/protocol/xhtml-im'>
<value>1</value> <value>1</value>
<option label='Disable'><value>0</value></option> <option label='Disable'><value>0</value></option>
<option label='Enable'><value>1</value></option> <option label='Enable'><value>1</value></option>
</field> </field>
<field label='Temporarily share presence?' <field label='Temporarily share presence?'
type='boolean' type='list-single'
var='presence' var='presence'
<value>1</value> <value>1</value>
<option label='Disable'><value>0</value></option> <option label='Disable'><value>0</value></option>
<option label='Enable'><value>1</value></option> <option label='Enable'><value>1</value></option>
</field> </field>
<field label='Chat State Notifications?' <field label='Chat State Notifications?'
type='boolean' type='list-single'
var='http://jabber.org/protocol/chatstates'> var='http://jabber.org/protocol/chatstates'>
<value>1</value> <value>1</value>
<option label='Disable'><value>0</value></option> <option label='Disable'><value>0</value></option>
@ -254,7 +263,7 @@ PENDING o---------------+
]]></example> ]]></example>
<p>The user MAY request a session with a specific resource of the contact. However, if the user specifies no resource (or if the specified resource is not available), then the contact's server delivers the request to the contact's most available resource (which in the examples below happens to be "balcony"). If no resource is available (and no <cite>Advanced Message Processing</cite> rule included in the request specifies otherwise) then the server MAY store the request for later delivery.</p> <p>The user MAY request a session with a specific resource of the contact. However, if the user specifies no resource (or if the specified resource is not available), then the contact's server delivers the request to the contact's most available resource (which in the examples below happens to be "balcony"). If no resource is available (and no <cite>Advanced Message Processing</cite> rule included in the request specifies otherwise) then the server MAY store the request for later delivery.</p>
</section2> </section2>
<section2 topic='Accepting a Chat' anchor='new-accept'> <section2 topic='Accepting a Chat Session' anchor='new-accept'>
<p>If, upon reception of a user's chat session request, a contact finds that the request had been stored for later delivery, and if the contact is interested only in an <em>immediate</em> chat session, then it SHOULD initiate a new chat session negotiation (including a newly-generated ThreadID) instead of responding to the user's request. Note: Sending any response to the user's original request would leak presence information since it would divulge the fact that the contact had been offline rather than just ignoring the user.</p> <p>If, upon reception of a user's chat session request, a contact finds that the request had been stored for later delivery, and if the contact is interested only in an <em>immediate</em> chat session, then it SHOULD initiate a new chat session negotiation (including a newly-generated ThreadID) instead of responding to the user's request. Note: Sending any response to the user's original request would leak presence information since it would divulge the fact that the contact had been offline rather than just ignoring the user.</p>
<p>In any response to the user's request, the contact's client MUST mirror the &THREAD; value so that the user's client can correctly track the response.</p> <p>In any response to the user's request, the contact's client MUST mirror the &THREAD; value so that the user's client can correctly track the response.</p>
<p>If the request is accepted then the contact's client MUST include in its response values for all the fields that the request indicated are required. If the contact's client does not support one of the default values or if the contact has disabled its support (as for Chat State Notifications and XHTML formatting in the example below), and the client can still accept the request, then it MUST set that field to a value that it can support.</p> <p>If the request is accepted then the contact's client MUST include in its response values for all the fields that the request indicated are required. If the contact's client does not support one of the default values or if the contact has disabled its support (as for Chat State Notifications and XHTML formatting in the example below), and the client can still accept the request, then it MUST set that field to a value that it can support.</p>
@ -286,7 +295,7 @@ PENDING o---------------+
]]></example> ]]></example>
<p>Note: Both entities MUST assume the session is being established with the resource of the contact that sends the reply, even if the user sent its request to a different resource of the contact.</p> <p>Note: Both entities MUST assume the session is being established with the resource of the contact that sends the reply, even if the user sent its request to a different resource of the contact.</p>
</section2> </section2>
<section2 topic='Rejecting a Chat' anchor='new-reject'> <section2 topic='Rejecting a Chat Session' anchor='new-reject'>
<p>If the contact does not want to reveal presence to the user for whatever reason then the contact's client SHOULD return no response or error (see <link url='#secure-leak'>Presence Leaks</link>). Also, if the contact is using a legacy client then it MAY not support returning any response or error. In both these cases the user MAY proceed to send stanzas to the contact outside the context of a negotiated chat session.</p> <p>If the contact does not want to reveal presence to the user for whatever reason then the contact's client SHOULD return no response or error (see <link url='#secure-leak'>Presence Leaks</link>). Also, if the contact is using a legacy client then it MAY not support returning any response or error. In both these cases the user MAY proceed to send stanzas to the contact outside the context of a negotiated chat session.</p>
<p>However, if the contact simply prefers not to chat then the client SHOULD decline the invitation. The data form MUST contain the FORM_TYPE field and the "accept" field set to "0" or "false". It is RECOMMENDED that the form does not contain any other fields even if the request indicated they are required. The client MAY include a reason in the &BODY; child of the &MESSAGE; stanza:</p> <p>However, if the contact simply prefers not to chat then the client SHOULD decline the invitation. The data form MUST contain the FORM_TYPE field and the "accept" field set to "0" or "false". It is RECOMMENDED that the form does not contain any other fields even if the request indicated they are required. The client MAY include a reason in the &BODY; child of the &MESSAGE; stanza:</p>
<example caption="Contact declines offer and specifies reason"><![CDATA[ <example caption="Contact declines offer and specifies reason"><![CDATA[
@ -370,7 +379,7 @@ PENDING o---------------+
]]></example> ]]></example>
</section2> </section2>
<section2 topic='Completing or Canceling the Negotiation' anchor='new-complete'> <section2 topic='Completing or Canceling the Negotiation' anchor='new-complete'>
<p>If the contact accepted the chat (see <link url='#new-accept'>Accepting a Chat</link>) then the user MUST either complete or cancel the session negotiation. If the contact chose an option other than the default (prefered) value for one or more of the fields, then instead of having the client accept the session automatically the user may prefer to review the values that the contact selected before confirming that the session is open. <note>See <cite>Encrypted Session Negotiation</cite> for example of other instances where the user might find the values submitted by the contact unacceptable.</note> In any case the user's client SHOULD verify that the selected values are acceptable before completing the session negotiation -- and confirming that the chat session is open -- by replying with a form with the form 'type' attribute set to 'result'. The form MUST contain the FORM_TYPE field and the "accept" field set to "1" or "true". The user MAY include other content (e.g., a &BODY; element) in the confirmation stanza:</p> <p>If the contact accepted the chat (see <link url='#new-accept'>Accepting a Chat Session</link>) then the user MUST either complete or cancel the session negotiation. If the contact chose an option other than the default (prefered) value for one or more of the fields, then instead of having the client accept the session automatically the user may prefer to review the values that the contact selected before confirming that the session is open. <note>See <cite>Encrypted Session Negotiation</cite> for example of other instances where the user might find the values submitted by the contact unacceptable.</note> In any case the user's client SHOULD verify that the selected values are acceptable before completing the session negotiation -- and confirming that the chat session is open -- by replying with a form with the form 'type' attribute set to 'result'. The form MUST contain the FORM_TYPE field and the "accept" field set to "1" or "true". The user MAY include other content (e.g., a &BODY; element) in the confirmation stanza:</p>
<example caption="User completes negotiation and confirms session is open"><![CDATA[ <example caption="User completes negotiation and confirms session is open"><![CDATA[
<message type='normal' <message type='normal'
from='romeo@montague.net/orchard' from='romeo@montague.net/orchard'
@ -405,8 +414,7 @@ PENDING o---------------+
]]></example> ]]></example>
</section2> </section2>
</section1> </section1>
<section1 topic='Other Use Cases' anchor='usecases'> <section1 topic='Moving A Chat Session to a Different Resource' anchor='move'>
<section2 topic='Switching Resources' anchor='switch'>
<p>Either party MAY ask to continue the session using another of its resources. The requesting party does this by submitting a form with a "continue" field containing the value of the new resource:</p> <p>Either party MAY ask to continue the session using another of its resources. The requesting party does this by submitting a form with a "continue" field containing the value of the new resource:</p>
<example caption="One party asks to switch session to another of its resources"><![CDATA[ <example caption="One party asks to switch session to another of its resources"><![CDATA[
<message type='normal' <message type='normal'
@ -441,8 +449,8 @@ PENDING o---------------+
</message> </message>
]]></example> ]]></example>
<p>Once the other party has accepted the switch then all stanzas sent within the chat session MUST be to or from the new resource. Note: Both parties MUST ensure that they comply with all the other chat session negotiation parameters that were previously agreed for this session.</p> <p>Once the other party has accepted the switch then all stanzas sent within the chat session MUST be to or from the new resource. Note: Both parties MUST ensure that they comply with all the other chat session negotiation parameters that were previously agreed for this session.</p>
</section2> </section1>
<section2 topic='Renegotiating a Chat' anchor='renegotiate'> <section1 topic='Renegotiating a Chat Session' anchor='renegotiate'>
<p>At any time during an existing chat session, either party MAY attempt to renegotiate the parameters of the session using the protocol described in <link url='#new'>Negotiating a New Chat Session</link>. The requesting party does this by sending a new &MESSAGE; stanza containing a feature negotiation form and a &THREAD; element with the <em>same</em> value as that of the existing chat session. Note: The "accept" field MUST NOT be included in a renegotiation form. The other fields MAY be different from the set of fields included in the initial session negotiation form.</p> <p>At any time during an existing chat session, either party MAY attempt to renegotiate the parameters of the session using the protocol described in <link url='#new'>Negotiating a New Chat Session</link>. The requesting party does this by sending a new &MESSAGE; stanza containing a feature negotiation form and a &THREAD; element with the <em>same</em> value as that of the existing chat session. Note: The "accept" field MUST NOT be included in a renegotiation form. The other fields MAY be different from the set of fields included in the initial session negotiation form.</p>
<example caption="One party requests renegotiation"><![CDATA[ <example caption="One party requests renegotiation"><![CDATA[
<message type='normal' <message type='normal'
@ -458,7 +466,7 @@ PENDING o---------------+
<value>1</value> <value>1</value>
<required/> <required/>
</field> </field>
<field label='Off-The-Record?' type='boolean' var='otr'> <field label='Off-The-Record?' type='list-single' var='otr'>
<value>1</value> <value>1</value>
<option label='Disable all message logging'> <option label='Disable all message logging'>
<value>1</value> <value>1</value>
@ -507,9 +515,9 @@ PENDING o---------------+
</feature> </feature>
</message> </message>
]]></example> ]]></example>
<p>If the other party's client does not support one or more of the <em>required</em> features, it SHOULD return a &feature; error. If the other party's client supports <em>none</em> of the options for one or more <em>required</em> fields, it SHOULD return a &notacceptable; error (see <link url='#new-reject'>Rejecting a Chat</link>). Note: In any of these cases the existing negotiated chat session parameters are maintained. Either party MAY choose to terminate the chat session only as specified in the section <link url='#terminate'>Terminating a Chat</link>.</p> <p>If the other party's client does not support one or more of the <em>required</em> features, it SHOULD return a &feature; error. If the other party's client supports <em>none</em> of the options for one or more <em>required</em> fields, it SHOULD return a &notacceptable; error (see <link url='#new-reject'>Rejecting a Chat Session</link>). Note: In any of these cases the existing negotiated chat session parameters are maintained. Either party MAY choose to terminate the chat session only as specified in the section <link url='#terminate'>Terminating a Chat Session</link>.</p>
</section2> </section1>
<section2 topic='Terminating a Chat' anchor='terminate'> <section1 topic='Terminating a Chat Session' anchor='terminate'>
<p>In order to explicitly terminate a negotiated chat, the party that wishes to end the chat MUST do so by sending a &MESSAGE; containing a data form of type "submit". The &MESSAGE; stanza MUST contain a &THREAD; element with the same XML character data as the original initiation request. The data form containing a boolean field named "terminate" set to a value of "1" or "true".</p> <p>In order to explicitly terminate a negotiated chat, the party that wishes to end the chat MUST do so by sending a &MESSAGE; containing a data form of type "submit". The &MESSAGE; stanza MUST contain a &THREAD; element with the same XML character data as the original initiation request. The data form containing a boolean field named "terminate" set to a value of "1" or "true".</p>
<example caption="One party terminates chat"><![CDATA[ <example caption="One party terminates chat"><![CDATA[
<message type='normal' <message type='normal'
@ -543,7 +551,6 @@ PENDING o---------------+
</feature> </feature>
</message> </message>
]]></example> ]]></example>
</section2>
</section1> </section1>
<section1 topic='Implementation Notes' anchor='impl'> <section1 topic='Implementation Notes' anchor='impl'>
<section2 topic='Auto Accept or Reject' anchor='impl-auto'> <section2 topic='Auto Accept or Reject' anchor='impl-auto'>
@ -564,7 +571,7 @@ PENDING o---------------+
</section2> </section2>
<section2 topic='Unavailable Presence' anchor='impl-unavail'> <section2 topic='Unavailable Presence' anchor='impl-unavail'>
<p>If a party receives an XMPP presence stanza of type "unavailable" from the full JID (&FULLJID;) of the other party (i.e., the resource with which it has had an active session) during a chat session, the receiving party SHOULD assume that the other client will still be able to continue the session (perhaps it simply became "invisible", or it is persisting the state of the negotiated chat until it reconnects and receives "offline" messages).</p> <p>If a party receives an XMPP presence stanza of type "unavailable" from the full JID (&FULLJID;) of the other party (i.e., the resource with which it has had an active session) during a chat session, the receiving party SHOULD assume that the other client will still be able to continue the session (perhaps it simply became "invisible", or it is persisting the state of the negotiated chat until it reconnects and receives "offline" messages).</p>
<p>However, the receiving party MAY assume that the other client will <em>not</em> be able to continue the session. <note>In general, if a party is not subscribing to the other party's presence then it will never assume the other party is is unable to continue a session.</note> In that case it MUST explicitly terminate the session (see <link url='#terminate'>Terminating a Chat</link>) -- since its assumption could be incorrect. If after terminating the session the receiving party later receives presence of type "available" from that same resource or another resource associated with the other party and the receiving party desires to restart the chat session, then it MUST initiate a new chat session (including a newly-generated ThreadID) with the other party. It MUST NOT renegotiate parameters for the terminated session. (Note: This is consistent with the handling of chat states as specified in <cite>XEP-0085</cite>.)</p> <p>However, the receiving party MAY assume that the other client will <em>not</em> be able to continue the session. <note>In general, if a party is not subscribing to the other party's presence then it will never assume the other party is is unable to continue a session.</note> In that case it MUST explicitly terminate the session (see <link url='#terminate'>Terminating a Chat Session</link>) -- since its assumption could be incorrect. If after terminating the session the receiving party later receives presence of type "available" from that same resource or another resource associated with the other party and the receiving party desires to restart the chat session, then it MUST initiate a new chat session (including a newly-generated ThreadID) with the other party. It MUST NOT renegotiate parameters for the terminated session. (Note: This is consistent with the handling of chat states as specified in <cite>XEP-0085</cite>.)</p>
</section2> </section2>
<section2 topic='Mapping to SIP' anchor='impl-sip'> <section2 topic='Mapping to SIP' anchor='impl-sip'>
<p>When mapping instant messaging flows to SIP, implementations SHOULD adhere to &xmppsimple;.</p> <p>When mapping instant messaging flows to SIP, implementations SHOULD adhere to &xmppsimple;.</p>
@ -636,7 +643,7 @@ PENDING o---------------+
</field> </field>
<field <field
var='http://jabber.org/protocol/chatstates' var='http://jabber.org/protocol/chatstates'
type='boolean' type='list-single'
label='Whether may send Chat State Notifications per XEP-0085'> label='Whether may send Chat State Notifications per XEP-0085'>
<option label='Must Not Send'> <option label='Must Not Send'>
<value>0</value> <value>0</value>
@ -647,7 +654,7 @@ PENDING o---------------+
</field> </field>
<field <field
var='http://jabber.org/protocol/xhtml-im' var='http://jabber.org/protocol/xhtml-im'
type='boolean' type='list-single'
label='Whether allowed to use XHTML-IM formatting per XEP-0071'> label='Whether allowed to use XHTML-IM formatting per XEP-0071'>
<option label='Must Not Send'> <option label='Must Not Send'>
<value>0</value> <value>0</value>
@ -664,7 +671,7 @@ PENDING o---------------+
conforms to RFC 4646 and the IANA registry)'/> conforms to RFC 4646 and the IANA registry)'/>
<field <field
var='otr' var='otr'
type='boolean' type='list-single'
label='Off-The-Record'> label='Off-The-Record'>
<option label='May log messages'> <option label='May log messages'>
<value>0</value> <value>0</value>
@ -675,6 +682,10 @@ PENDING o---------------+
<value>1</value> <value>1</value>
</option> </option>
</field> </field>
<field
var='renegotiate'
type='boolean'
label='Whether to renegotiate the session'/>
<field <field
var='security' var='security'
type='list-single' type='list-single'