1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

XEP-0186: specify whether server sends probes

Fixes #109
This commit is contained in:
Peter Saint-Andre 2017-01-28 19:38:46 -07:00 committed by Sam Whited
parent 3ddc17b21e
commit b699d09b1f

View File

@ -7,11 +7,10 @@
<xep>
<header>
<title>Invisible Command</title>
<abstract>This document specifies an XMPP-compatible protocol for user invisibility.</abstract>
<abstract>This document specifies an XMPP protocol extension for user invisibility.</abstract>
&LEGALNOTICE;
<number>0186</number>
<status>Deferred</status>
<lastcall>2014-07-03</lastcall>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<dependencies>
@ -25,6 +24,12 @@
<supersededby/>
<shortname>invisible</shortname>
&stpeter;
<revision>
<version>0.12</version>
<date>2017-01-28</date>
<initials>psa</initials>
<remark><p>Added method for specifying server behavior regarding presence probes via new 'probe' attribute; increased the protocol version number from 0 to 1.</p></remark>
</revision>
<revision>
<version>0.11</version>
<date>2012-06-27</date>
@ -106,12 +111,12 @@
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Some XMPP-based instant messaging systems have long supported the ability for users to be online but to appear invisible. The existing protocols for doing so are:</p>
<p>Some XMPP-based instant messaging systems have long supported the ability for users to be online but to appear offline to other users. The existing protocols for this "invisibility" feature are:</p>
<ul>
<li><p>&xep0018; -- this protocol is not compatible with &xmppcore; and &xmppim; (also, the specification does not provide reliable documentation of the protocol in use, since many server implementations support presence of type "invisible" but not presence of type "visible").</p></li>
<li><p>&xep0126; -- this protocol is a somewhat complicated use of &xep0016; for the temporary purpose of appearing invisible rather than the intended purpose of permanently blocking communications; however, the invisible command defined herein can provide a client-friendly interface to the same data store used for privacy lists.</p></li>
<li><p>&xep0018; -- this protocol is not compatible with &xmppcore; and &xmppim; because it defines new values of the 'type' attribute for the &PRESENCE; outside of the IETF (also, the specification does not provide reliable documentation of the protocol in use, since many server implementations support presence of type "invisible" but not presence of type "visible").</p></li>
<li><p>&xep0126; -- this protocol is a somewhat complicated profile of &xep0016; to enable temporary invisibility, and violates the spirit of XEP-0016, which was defined to enable permanent blocking of communications instead of per-session interactions (nevertheless, the invisible command defined here can provide a client-friendly interface to the same data backend used for privacy lists).</p></li>
</ul>
<p>In order to provide a standards-compliant protocol that can be used in the long term, this document defines an IQ-based protocol that enables an IM user to become "invisible" and "visible" at will within the context of a given session. This protocol is intended to supersede the protocol described in <cite>XEP-0018</cite> and to provide a more client-friendly approach to invisibility than <cite>XEP-0126</cite>.</p>
<p>In order to provide a standards-compliant protocol extension that can be used in the long term, this document defines an IQ-based protocol that enables an IM user to become "invisible" and "visible" at will within the context of a given session.</p>
</section1>
<section1 topic='Requirements' anchor='req'>
@ -119,34 +124,44 @@
<ol start='1'>
<li>A user can become visible or invisible at any time within an XMPP session.</li>
<li>Invisible mode is active only for the current session; if the user ends that session and starts another session, the invisibility mode set for the previous session does not carry over to the new session.</li>
<li>When in invisible mode, a user can send directed presence to particular contacts.</li>
<li>When in invisible mode, a user can send messages and directed presence to particular contacts.</li>
</ol>
</section1>
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='User Becomes Invisible' anchor='invisible'>
<p>In order for a client to go invisible, it sends an IQ-set with no 'to' address (thus handled by the user's server) containing an &lt;invisible/&gt; element qualified by the 'urn:xmpp:invisible:0' namespace &VNOTE;.</p>
<example caption='Invisible command'><![CDATA[
<iq from='bilbo@tolkien.lit/shire'
id='inv1'
<p>In order for a client to go invisible, it sends an IQ-set with no 'to' address (thus handled by the user's server) containing an &lt;invisible/&gt; element qualified by the 'urn:xmpp:invisible:1' namespace &VNOTE;.</p>
<p>The &lt;invisible/&gt; element MUST include a 'probe' attribute, which specifies whether the server shall or shall not send presence probes to entities in the user's roster (thus determining whether the user does or does not automatically receive presence notifications from contacts). This attribute is a boolean &BOOLEANNOTE;, where a logical value of TRUE (lexical value of "true" or "1") indicates that the server shall send presence probes and where a logical value of FALSE (lexical value of "false" or "0") indicates that the server shall not send presence probes. The default logical value is FALSE.</p>
<example caption='Invisible command with indication to send presence probes'><![CDATA[
<iq from='bilbo@tolkien.example/shire'
id='d1s4pp34r1'
type='set'>
<invisible xmlns='urn:xmpp:invisible:0'/>
<invisible probe='true' xmlns='urn:xmpp:invisible:1'/>
</iq>
]]></example>
<p>If the server can successfully process the invisibility command, it MUST return an IQ-result.</p>
<p>Although the default value is false (thus protecting the user from leaking presence information), the client SHOULD always include the 'probe' attribute.</p>
<example caption='Invisible command with indication to not send presence probes'><![CDATA[
<iq from='bilbo@tolkien.example/shire'
id='d1s4pp34r2'
type='set'>
<invisible probe='false' xmlns='urn:xmpp:invisible:1'/>
</iq>
]]></example>
<p>If the server can successfully process the invisible command, it MUST return an IQ-result.</p>
<example caption='Invisible command is successful'><![CDATA[
<iq to='bilbo@tolkien.lit/shire'
id='inv1'
<iq to='bilbo@tolkien.example/shire'
id='d1s4pp34r2'
type='result'/>
]]></example>
<p>(Standard XMPP stanza errors apply; see <cite>RFC 6120</cite>.)</p>
<p>When the client enters invisible mode in the midst of a presence session (i.e., after having previously sent undirected available presence with no 'type' attribute), the server MUST send &UNAVAILABLE; presence from the specified resource to all contacts who would receive unavailable presence if the client sent &UNAVAILABLE;.</p>
<p>The following sections define how the server and the client handling of inbound and outbound XML stanzas while the client is invisible.</p>
<p>When the client enters invisible mode during a presence session (i.e., after having previously sent undirected available presence with no 'type' attribute), the server MUST send &UNAVAILABLE; from the specified resource to all contacts who would receive unavailable presence if the client itself were to send &UNAVAILABLE;.</p>
<p>The following sections define server and client handling of inbound and outbound XML stanzas while the client is invisible.</p>
<section3 topic='Server Handling' anchor='invisible-server'>
<p>While the client is in invisible mode, the server:</p>
<ol start='1'>
<li><p>MUST NOT broadcast outbound presence notifications as a result of receiving any subsequent undirected presence notifications from the client.</p></li>
<li><p>MUST deliver outbound directed presence stanzas generated by the client.</p></li>
<li><p>MUST generate or not generate outbound presence probes in accordance with the value of the 'probe' attribute.</p></li>
<li><p>MUST deliver inbound &PRESENCE; stanzas.</p></li>
<li><p>SHOULD deliver inbound &MESSAGE; stanzas whose 'to' address is the bare JID &LOCALBARE; of the user (subject to standard XMPP stanza handling rules from <cite>RFC 6120</cite> and <cite>RFC 6121</cite>).</p></li>
<li><p>MUST deliver inbound &MESSAGE; and &IQ; stanzas whose 'to' address is the full JID &LOCALFULL; corresponding to the resource of the client.</p></li>
@ -171,59 +186,59 @@
</section3>
</section2>
<section2 topic='User Becomes Visible' anchor='visible'>
<p>In order for a client to become visible again, it sends an IQ-set with no 'to' address (thus handled by the user's server) containing a &lt;visible/&gt; element qualified by the 'urn:xmpp:invisible:0' namespace &VNOTE;.</p>
<p>In order for a client to become visible again, it sends an IQ-set with no 'to' address (thus handled by the user's server) containing a &lt;visible/&gt; element qualified by the 'urn:xmpp:invisible:1' namespace &VNOTE;.</p>
<example caption='Visible command'><![CDATA[
<iq from='bilbo@tolkien.lit/shire'
id='vis1'
<iq from='bilbo@tolkien.example/shire'
id='r34pp34r'
type='set'>
<visible xmlns='urn:xmpp:invisible:0'/>
<visible xmlns='urn:xmpp:invisible:1'/>
</iq>
]]></example>
<p>If the server can successfully process the visibility command, it MUST return an IQ-result.</p>
<example caption='Visible command is successful'><![CDATA[
<iq to='bilbo@tolkien.lit/shire'
id='vis1'
<iq to='bilbo@tolkien.example/shire'
id='r34pp34r'
type='result'/>
]]></example>
<p>When the client becomes visible, the server MUST treat that state as equivalent to an active session before receiving initial presence from the client, with one exception: if the client sent directed presence to any entities while in the invisible state, the server MUST treat those entities as under point 2 of Section 4.6.3 of RFC 6121 (i.e., the server MUST ensure that it sends unavailable presence to those entities if the client subsequently goes offline after becoming visible).</p>
<p>If the user wishes to then send presence to contacts, it is the responsibility of the client to send an undirected available presence notification to the server.</p>
<example caption='Client sends presence'><![CDATA[
<p>If the user wishes to then send presence to all contacts in the roster, it is the responsibility of the client to send an undirected available presence notification to the server.</p>
<example caption='Client sends available presence for roster broadcast'><![CDATA[
<presence/>
]]></example>
<p>The server would then broadcast that presence notification to all entities who would normally receive presence broadcasts from the client (the server MAY also send that notification to any entities to which the client sent directed presence while invisible).</p>
<p>The server would then broadcast that presence notification to all entities who would normally receive presence broadcasts from the client (the server MAY also send that notification to any entities to which the client sent directed presence while invisible, whether or not they are in the user's roster).</p>
</section2>
</section1>
<section1 topic='Discovering Support' anchor='support'>
<p>In order for a client to discover whether its server supports the invisible command, it sends a &xep0030; information request to the server:</p>
<example caption='Service discovery request'><![CDATA[
<iq from='bilbo@tolkien.lit/shire'
id='disco1'
to='tolkien.lit'
<iq from='bilbo@tolkien.example/shire'
id='d1sc0v3ry'
to='tolkien.example'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<p>If the server supports the invisible command, it MUST return a feature of "urn:xmpp:invisible:0" &VNOTE;.</p>
<p>If the server supports the invisible command, it MUST return a feature of "urn:xmpp:invisible:1" &VNOTE;.</p>
<example caption='Service discovery response'><![CDATA[
<iq from='bilbo@tolkien.lit/shire'
id='disco1'
to='tolkien.lit'
<iq from='bilbo@tolkien.example/shire'
id='d1sc0v3ry'
to='tolkien.example'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:invisible:0'/>
<feature var='urn:xmpp:invisible:1'/>
</query>
</iq>
]]></example>
<p>A client SHOULD complete this service discovery process before sending initial presence to its server.</p>
<p>A client SHOULD complete this service discovery process before sending initial presence to its server (as specified in &xep0115;, a server can include entity capabilities information in a stream feature, which obviates the need for explicit service discovery as shown above).</p>
</section1>
<section1 topic='Integration With Privacy Lists' anchor='priv'>
<p>A server MAY use the same backend data store for this invisibility mode as for &xep0016; when used for invisibility (see <cite>XEP-0126</cite>). If so, the server MUST update the relevant privacy lists on behalf of the user when the client requests initiation or termination of invisible mode.</p>
<p>A server MAY use the same data backend for this invisibility mode as for privacy lists when employed for invisibility (see <cite>XEP-0126</cite>). If so, the server MUST update the relevant privacy lists on behalf of the user when the client sends an invisible command or a visible command as specified herein.</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>No matter how it is implemented, invisibility can be defeated and presence leaks can occur without careful stanza handling on the part of the server and the client. Use of the protocol defined here does not guarantee that presence leaks will not occur, either technically or socially (e.g., if the user reveals his presence to one contact but not another and those contacts are in communication).</p>
<p>No matter how it is implemented, invisibility can be defeated and presence leaks can occur without careful stanza handling on the part of the server and the client. Use of the protocol defined here does not necessarily prevent presence leaks, either technically or socially (e.g., if the user reveals his presence to one contact but not another and those contacts are in communication).</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
@ -234,7 +249,7 @@
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:invisible:0</li>
<li>urn:xmpp:invisible:1</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>
@ -249,11 +264,22 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:invisible:0'
xmlns='urn:xmpp:invisible:0'
targetNamespace='urn:xmpp:invisible:1'
xmlns='urn:xmpp:invisible:1'
elementFormDefault='qualified'>
<xs:element name='invisible' type='empty'/>
<xs:element name='invisible'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='empty'>
<xs:attribute name='probe'
type='xs:boolean'
use='optional'
default='false'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='visible' type='empty'/>