XEP-0186: Invisible Command

Abstract:This document specifies an XMPP-compatible protocol for user invisibility.
Author:Peter Saint-Andre
Copyright:© 1999 - 2014 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Proposed
Type:Standards Track
Version:0.11
Last Updated:2012-06-27

NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the XSF standards process. The Last Call ends on 2014-07-03. Please send your feedback to the standards@xmpp.org discussion list.


Table of Contents


1. Introduction
2. Requirements
3. Use Cases
    3.1. User Becomes Invisible
       3.1.1. Server Handling
       3.1.2. Client Handling
    3.2. User Becomes Visible
4. Discovering Support
5. Integration With Privacy Lists
6. Security Considerations
7. IANA Considerations
8. XMPP Registrar Considerations
    8.1. Protocol Namespaces
    8.2. Protocol Versioning
9. XML Schema
10. Acknowledgements

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

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:

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 XEP-0018 and to provide a more client-friendly approach to invisibility than XEP-0126.

2. Requirements

The requirements for invisible mode are straightforward:

  1. A user can become visible or invisible at any time within an XMPP session.
  2. 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.
  3. When in invisible mode, a user can send directed presence to particular contacts.

3. Use Cases

3.1 User Becomes Invisible

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 <invisible/> element qualified by the 'urn:xmpp:invisible:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 1. Invisible command

<iq from='bilbo@tolkien.lit/shire'
    id='inv1'
    type='set'>
  <invisible xmlns='urn:xmpp:invisible:0'/>
</iq>
    

If the server can successfully process the invisibility command, it MUST return an IQ-result.

Example 2. Invisible command is successful

<iq to='bilbo@tolkien.lit/shire'
    id='inv1'
    type='result'/>
    

(Standard XMPP stanza errors apply; see RFC 6120.)

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 <presence type='unavailable'/> presence from the specified resource to all contacts who would receive unavailable presence if the client sent <presence type='unavailable'/>.

The following sections define how the server and the client handling of inbound and outbound XML stanzas while the client is invisible.

3.1.1 Server Handling

While the client is in invisible mode, the server:

  1. MUST NOT broadcast outbound presence notifications as a result of receiving any subsequent undirected presence notifications from the client.

  2. MUST deliver outbound directed presence stanzas generated by the client.

  3. MUST deliver inbound <presence/> stanzas.

  4. SHOULD deliver inbound <message/> stanzas whose 'to' address is the bare JID <localpart@domain.tld> of the user (subject to standard XMPP stanza handling rules from RFC 6120 and RFC 6121).

  5. MUST deliver inbound <message/> and <iq/> stanzas whose 'to' address is the full JID <localpart@domain.tld/resource> corresponding to the resource of the client.

  6. MUST deliver outbound <message/> and <iq/> stanzas generated by the client (for an important note regarding presence leaks, see the Security Considerations section of this document).

  7. 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:

    • 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 invisible.
    • If the server responds to a Last Activity (XEP-0012) [6] request, the last activity time MUST be the time when the client went invisible.
    • If the server responds to a Service Discovery (XEP-0030) [7] items request, the response MUST NOT include the invisible resource as one of the account's available items.
  8. If after sending directed presence the client then sends <presence type='unavailable'/>, the server MUST deliver that unavailable presence only to the entities to which the client sent directed presence after going invisible.

3.1.2 Client Handling

While the client is in invisible mode, it is suggested that the client behave as follows:

3.2 User Becomes Visible

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 <visible/> element qualified by the 'urn:xmpp:invisible:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 3. Visible command

<iq from='bilbo@tolkien.lit/shire'
    id='vis1'
    type='set'>
  <visible xmlns='urn:xmpp:invisible:0'/>
</iq>
    

If the server can successfully process the visibility command, it MUST return an IQ-result.

Example 4. Visible command is successful

<iq to='bilbo@tolkien.lit/shire'
    id='vis1'
    type='result'/>
    

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).

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.

Example 5. Client sends presence

<presence/>
    

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).

4. Discovering Support

In order for a client to discover whether its server supports the invisible command, it sends a Service Discovery (XEP-0030) [8] information request to the server:

Example 6. Service discovery request

<iq from='bilbo@tolkien.lit/shire'
    id='disco1'
    to='tolkien.lit'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

If the server supports the invisible command, it MUST return a feature of "urn:xmpp:invisible:0" (see Namespace Versioning regarding the possibility of incrementing the version number).

Example 7. Service discovery response

<iq from='bilbo@tolkien.lit/shire'
    id='disco1'
    to='tolkien.lit'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:invisible:0'/>
  </query>
</iq>
  

A client SHOULD complete this service discovery process before sending initial presence to its server.

5. Integration With Privacy Lists

A server MAY use the same backend data store for this invisibility mode as for Privacy Lists (XEP-0016) [9] when used for invisibility (see XEP-0126). 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.

6. Security Considerations

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).

7. IANA Considerations

No interaction with the Internet Assigned Numbers Authority (IANA) [10] is required as a result of this document.

8. XMPP Registrar Considerations

8.1 Protocol Namespaces

This specification defines the following XML namespace:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [11] shall add the foregoing namespace to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [12].

8.2 Protocol Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, 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 XEP-0053.

9. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:invisible:0'
    xmlns='urn:xmpp:invisible:0'
    elementFormDefault='qualified'>

  <xs:element name='invisible' type='empty'/>

  <xs:element name='visible' type='empty'/>

  <xs:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
  

10. Acknowledgements

Thanks to Philipp Hancke, Kevin Smith, and Matthew Wild for their feedback.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0186
Publisher: XMPP Standards Foundation
Status: Proposed
Type: Standards Track
Version: 0.11
Last Updated: 2012-06-27
Approving Body: XMPP Council
Dependencies: XMPP Core, XMPP IM, XEP-0030
Supersedes: XEP-0018
Superseded By: None
Short Name: invisible
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2014 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. XEP-0018: Invisible Presence <http://xmpp.org/extensions/xep-0018.html>.

2. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.

3. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.

4. XEP-0126: Invisibility <http://xmpp.org/extensions/xep-0126.html>.

5. XEP-0016: Privacy Lists <http://xmpp.org/extensions/xep-0016.html>.

6. XEP-0012: Last Activity <http://xmpp.org/extensions/xep-0012.html>.

7. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

8. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

9. XEP-0016: Privacy Lists <http://xmpp.org/extensions/xep-0016.html>.

10. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

11. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.

12. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.11 (2012-06-27)

Clarified handling of directed presence while in invisible state.

(psa)

Version 0.10 (2012-05-29)

Further clarified server and client handling of stanzas during an invisibility session; updated RFC references.

(psa)

Version 0.9 (2008-10-07)

Further clarified server and client handling of stanzas during an invisibility session.

(psa)

Version 0.8 (2008-10-06)

Modified namespace to incorporate namespace versioning.

(psa)

Version 0.7 (2008-05-12)

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.

(psa)

Version 0.6 (2007-09-05)

Clarified that this specification is intended to supersede XEP-0018 and XEP-0126; added several additional examples.

(psa)

Version 0.5 (2007-01-30)

Modified XML namespace name to conform to XEP-0053 processes.

(psa)

Version 0.4 (2006-08-09)

Added XMPP Registrar considerations and XML schema.

(psa)

Version 0.3 (2006-08-02)

Added inbound presence rule to server handling section.

(psa)

Version 0.2 (2006-07-07)

Clarified that invisibility mode does not carry across sessions.

(psa)

Version 0.1 (2006-05-30)

Initial version.

(psa)

Version 0.0.2 (2006-05-15)

Recommended delivery of messages sent to bare JID.

(psa)

Version 0.0.1 (2006-05-11)

First draft.

(psa)

END