This commit is contained in:
Peter Saint-Andre 2012-10-08 09:51:12 -06:00
parent e5099cdad9
commit 97cb6900a9
1 changed files with 51 additions and 34 deletions

View File

@ -39,6 +39,12 @@
<email>linuxwolf@outer-planes.net</email>
<jid>linuxwolf@outer-planes.net</jid>
</author>
<revision>
<version>0.7</version>
<date>2012-10-12</date>
<initials>mm</initials>
<remark><p>Moved carbons &lt;received/&gt; and &lt;sent/&gt; flags from being a sibling of &lt;forwarded/&gt; to being a parent of &lt;forwarded/&gt;, in compliance with XEP-0297.</p></remark>
</revision>
<revision>
<version>0.6</version>
<date>2012-01-06</date>
@ -114,7 +120,7 @@
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Discovering Support' anchor='disco'>
<p>If a server implements the Message Carbons capability, it MUST specify the "urn:xmpp:carbons:1" feature in its service discovery information features as specified in &xep0030; or section 6.3 of &xep0115;. Clients SHOULD NOT attempt to enable or disable Carbons if their server does not support this feature.</p>
<p>If a server implements the Message Carbons capability, it MUST specify the "urn:xmpp:carbons:2" feature in its service discovery information features as specified in &xep0030; or section 6.3 of &xep0115;. Clients SHOULD NOT attempt to enable or disable Carbons if their server does not support this feature.</p>
<example caption='Client requests information about its own server'><![CDATA[
<iq xmlns='jabber:client'
type='get'
@ -130,7 +136,7 @@
id='info1'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:carbons:1'/>
<feature var='urn:xmpp:carbons:2'/>
...
</query>
</iq>]]></example>
@ -142,7 +148,7 @@
<iq xmlns='jabber:client'
type='set'
id='enable1'>
<enable xmlns='urn:xmpp:carbons:1'/>
<enable xmlns='urn:xmpp:carbons:2'/>
</iq>]]></example>
<p>Carbons will generally be enabled before the client sends the first undirected presence, to ensure that all inbound messages will be delivered according to the Carbon rules. The server will respond with an IQ result when Carbons are enabled:</p>
<example caption='Server acknowledges Carbons enablement'><![CDATA[
@ -157,7 +163,7 @@
<iq xmlns='jabber:client'
type='set'
id='disable1'>
<disable xmlns='urn:xmpp:carbons:1'/>
<disable xmlns='urn:xmpp:carbons:2'/>
</iq>]]></example>
<p>The server will respond with an IQ result when Carbons are disabled:</p>
<example caption='Server acknowledges Carbons disablement'><![CDATA[
@ -265,23 +271,24 @@
</message>
]]></example>
<p>The copies sent to the Carbon-enabled resources are wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbon-enabled user's bare JID (e.g. "localpart@domain"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a &lt;received xmlns='urn:xmpp:carbons:1'/&gt; element and a &lt;forwarded xmlns='urn:xmpp:forward:0'/&gt; which contains the original message (properly namespaced as "jabber:client"):</p>
<p>The copies sent to the Carbon-enabled resources are wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbon-enabled user's bare JID (e.g. "localpart@domain"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a &lt;received xmlns='urn:xmpp:carbons:2'/&gt; element and a &lt;forwarded xmlns='urn:xmpp:forward:0'/&gt; which contains the original message (properly namespaced as "jabber:client"):</p>
<example caption='Server sends carbon to Romeo&apos;s other clients'><![CDATA[
<message xmlns='jabber:client'
from='romeo@example.net'
to='romeo@example.net/home'
type='chat'>
<received xmlns='urn:xmpp:carbons:1'/>
<forwarded xmlns='urn:xmpp:forward:0'>
<message xmlns='jabber:client'
from='juliet@example.com/balcony'
to='romeo@example.net/garden'
type='chat'>
<body>What man art thou that, thus bescreen'd in night, so stumblest on my counsel?</body>
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
</message>
</forwarded>
<received xmlns='urn:xmpp:carbons:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<message xmlns='jabber:client'
from='juliet@example.com/balcony'
to='romeo@example.net/garden'
type='chat'>
<body>What man art thou that, thus bescreen'd in night, so stumblest on my counsel?</body>
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
</message>
</forwarded>
</received>
</message>
]]></example>
</section2>
@ -297,7 +304,7 @@
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
</message>]]></example>
<p>The copies sent to the Carbon-enabled resources are wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbon-enabled user's bare JID (e.g. "localpart@domain"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a &lt;sent xmlns='urn:xmpp:carbons:1'/> element and a &lt;forwarded xmlns='urn:xmpp:forward:0'/&gt; which contains the original message (properly namespaced as "jabber:client"):</p>
<p>The copies sent to the Carbon-enabled resources are wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbon-enabled user's bare JID (e.g. "localpart@domain"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a &lt;sent xmlns='urn:xmpp:carbons:2'/> element and a &lt;forwarded xmlns='urn:xmpp:forward:0'/&gt; which contains the original message (properly namespaced as "jabber:client"):</p>
<example caption='Romeo&apos;s other Carbons-enabled clients
receive a copy'><![CDATA[
@ -305,23 +312,24 @@
from='romeo@example.net'
to='romeo@example.net/garden'
type='chat'>
<sent xmlns='urn:xmpp:carbons:1'/>
<forwarded xmlns='urn:xmpp:forward:0'>
<message xmlns='jabber:client'
to='juliet@example.com/balcony'
from='romeo@example.net/home'
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
</message>
</forwarded>
<sent xmlns='urn:xmpp:carbons:2'>
<forwarded xmlns='urn:xmpp:forward:0'>
<message xmlns='jabber:client'
to='juliet@example.com/balcony'
from='romeo@example.net/home'
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
</message>
</forwarded>
</sent>
</message>]]></example>
</section2>
<section2 topic='Avoiding Carbons for a single message' anchor='avoiding'>
<p>Some clients might want to avoid carbons on a single message, while still keeping all of the other semantics of Carbon support. This might be useful for clients sending end-to-end encrypted messages, for example.</p>
<p>To avoid a message being Carbon-copied to its other resources, the sending client MUST add a private element in the "urn:xmpp:carbons:1" namespace. When the sending server receives the message, it MUST NOT make carbon copies to the other Carbons-enabled resources, and MUST remove the private element before forwarding the message to the intended recipient.</p>
<p>To avoid a message being Carbon-copied to its other resources, the sending client MUST add a private element in the "urn:xmpp:carbons:2" namespace. When the sending server receives the message, it MUST NOT make carbon copies to the other Carbons-enabled resources, and MUST remove the private element before forwarding the message to the intended recipient.</p>
<p><strong>Note:</strong> use of the private mechanism will lead to partial conversations on other devices. This is the intended effect.</p>
@ -332,7 +340,7 @@
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<thread>0e3141cd80894871a68e6fe6b1ec56fa</thread>
<private xmlns='urn:xmpp:carbons:1'/>
<private xmlns='urn:xmpp:carbons:2'/>
</message>]]></example>
<example caption='Romeo&apos;s server removes the private tag before forwarding, and does NOT send carbon copies to Romeo&apos;s other resources'><![CDATA[
@ -379,7 +387,7 @@
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:carbons:1</li>
<li>urn:xmpp:carbons:2</li>
</ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
</section2>
@ -393,8 +401,8 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:carbons:1'
xmlns='urn:xmpp:carbons:1'
targetNamespace='urn:xmpp:carbons:2'
xmlns='urn:xmpp:carbons:2'
elementFormDefault='qualified'>
<xs:element name='disable' type='empty'/>
@ -403,15 +411,24 @@
<xs:element name='private' type='empty'/>
<xs:element name='received' type='empty'/>
<xs:element name='received' type='forward-container'/>
<xs:element name='sent' type='empty'/>
<xs:element name='sent' type='forward-container'/>
<xs:simpleType name='empty'>
<xs:simpleType name='empty' abstract='true'>
<xs:restriction base='xs:string'>
<xs:enumeration value=''/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name='foward-container' abstract='true'>
<xs:choice>
<xs:element name='forwarded'
namespace='urn:xmpp:forward:0'
minOccurs='1'
maxOccurs='1'/>
</xs:choice>
</xs:complexType>
</xs:schema>
]]></code>