<remark><p>Added note about integration with privacy lists; removed XEP-0126 from list of protocols that this specification supersedes; changed temporary namespace to conform to XMPP Registrar procedures; copied several security considerations from XEP-0126.</p></remark>
<p>Some instant messaging implementations of the Jabber/XMPP protocols have long supported the ability for IM users to be online but appear invisible. The existing protocols for doing so are:</p>
<li><p>&xep0018; -- this protocol is not compatible with &xmppcore; and &xmppim;, and 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>
<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>
<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>
<p>In order for a client to go invisible, it shall send an IQ-set with no 'to' address (thus handled by the user's server) containing an <invisible/> element qualified by the 'urn:xmpp:invisible:0' namespace &VNOTE;.</p>
<p>When the client enters invisible mode in the midst of a presence session (i.e., after having previously sent undirected 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 shall handle inbound and outbound XML stanzas while the client is invisible.</p>
<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).</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>
<li><p>MUST deliver outbound &MESSAGE; and &IQ; stanzas generated by the client (for an important note regarding presence leaks, see the <linkurl='#security'>Security Considerations</link> section of this document).</p></li>
<li>
<p>If there are no other available resources, MUST respond to all IQ-get requests and presence probes sent to the account's bare JID as if the account were offline; this includes but is not limited to the following:</p>
<ul>
<li>If the server responds to a presence probe, the last available presence MUST indicate that the user is unavailable, and if a time is indicated it MUST be the time when the client went invisibile.</li>
<li>If the server responds to a &xep0012; request, the last activity time MUST be the time when the client went invisible.</li>
<li>If the server responds to a &xep0030; items request, the response MUST NOT include the invisible resource as one of the account's available items.</li>
</ul>
</li>
<li><p>If after sending directed presence the client then sends &UNAVAILABLE;, the server MUST deliver that unavailable presence only to the entities to which the client sent directed presence after going invisible.</p></li>
<p>While the client is in invisible mode, the client:</p>
<ul>
<li><p>MUST maintain a temporary list of entities with which communication is allowed, and prompt the user before adding any entity to that "communicants list" for this invisibility session; the list MAY be auto-populated with trusted entities if so configured by the user.</p></li>
<li><p>MUST prompt the user before sending any outbound traffic (message, presence, or IQ stanza) to a contact even if the user generated such traffic; upon receiving authorization from the user, the client SHOULD add the authorized entity to the communicants list for this invisibility session.</p></li>
<p>In order for a client to become visible again, it shall send an IQ-set with no 'to' address (thus handled by the user's server) containing a <visible/> element qualified by the 'urn:xmpp:invisible:0' namespace &VNOTE;.</p>
<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.</p>
<p>It is the responsibility of the client to send an undirected presence notification to the server.</p>
<p>The server then MUST broadcast that presence to all entities who would normally receive presence broadcasts from the client (as well as any other entities to which the client sent directed presence while invisible).</p>
<p>In order for a client to discover whether its server supports the protocol defined herein, it MUST send a &xep0030; information request to the server:</p>
<section1topic='Integration With Privacy Lists'anchor='priv'>
<p>A server MAY use the same backend data store for invisibility mode as defined herein and &xep0016; as 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>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>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:invisible:0</li>
</ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
<p>If the protocol defined in this specification undergoes a major revision that is not fully backward-compatible with an older version, or that contains significant new features, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of <cite>XEP-0053</cite>.</p>