mirror of
https://github.com/moparisthebest/xeps
synced 2024-12-21 23:28:51 -05:00
1.2pre1
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@511 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
parent
acd088763c
commit
4317fc36c1
94
xep-0012.xml
94
xep-0012.xml
@ -10,8 +10,8 @@
|
||||
<abstract>This document defines an XMPP protocol extension for retrieving information about the last activity associated with a Jabber entity.</abstract>
|
||||
&LEGALNOTICE;
|
||||
<number>0012</number>
|
||||
<status>Active</status>
|
||||
<type>Historical</type>
|
||||
<status>Draft</status>
|
||||
<type>Standards Track</type>
|
||||
<sig>Standards</sig>
|
||||
<dependencies>
|
||||
<spec>XMPP Core</spec>
|
||||
@ -26,6 +26,12 @@
|
||||
&jer;
|
||||
&temas;
|
||||
&stpeter;
|
||||
<revision>
|
||||
<version>1.2pre1</version>
|
||||
<date>in progress, last updated 2007-02-09</date>
|
||||
<initials>psa</initials>
|
||||
<remark>Per a vote of the XMPP Council, changed from Historical and Active to Standards Track and Draft; added Implementation Notes and clarified text throughout; added proviso to security considerations regarding client support.</remark>
|
||||
</revision>
|
||||
<revision>
|
||||
<version>1.1</version>
|
||||
<date>2004-01-22</date>
|
||||
@ -57,68 +63,89 @@
|
||||
<remark>Initial version from website.</remark>
|
||||
</revision>
|
||||
</header>
|
||||
<section1 topic='Introduction'>
|
||||
<p>It is often helpful to know the time of the last activity associated with a Jabber Entity. The canonical usage is to discover when a disconnected user last accessed the server (a closely related usage is to discover when a connected user was last active on the server, i.e., the user's idle time). The 'jabber:iq:last' namespace provides a method for retrieving this kind of information. In historical usage, the 'jabber:iq:last' namespace has also been used to query Jabber servers and components about their current uptime; however, this is an extension to the core usage of the 'jabber:iq:last' namespace and may require the addition of a separate namespace in the future.</p>
|
||||
<p>Although the 'jabber:iq:last' namespace has been in use since January 2001, it is still not considered one of the standard Jabber protocols. While the &jabberd; server, many components, and some clients already implement this namespace, it is often overlooked by new developers because of the lack of standardization. This informational document defines the protocol as it is used today in order to more fully document it for historical purposes.</p>
|
||||
<section1 topic='Introduction' anchor='intro'>
|
||||
<p>It is often helpful to know the time of the last activity associated with a entity. The canonical usage is to discover when a disconnected user last accessed the server. The 'jabber:iq:last' namespace provides a method for retrieving that information. The 'jabber:iq:last' namespace can also be used to discover when a connected user was last active on the server (i.e., the user's idle time) or to query servers and components about their current uptime.</p>
|
||||
</section1>
|
||||
<section1 topic='Basic Protocol'>
|
||||
<p>The 'jabber:iq:last' namespace is used as the value of the 'xmlns' attribute of a <query> element contained within an <iq/> element. When requesting last activity information, a Jabber Entity sends an <iq> element of type='get' to another Jabber Entity (i.e., a JID). When responding to such a request, a Jabber Entity sends an <iq> element of type='result'. The <query> element never has any children and contains only one attribute and CDATA, depending on the scenario in which it is used.</p>
|
||||
<p>As currently implemented, the Jabber Entity receiving an IQ reply in the 'jabber:iq:last' namespace must interpret it based on the sending JID's type in order to determine the meaning of the information. Specifically, currently the information means something different depending on whether the JID sending the reply is of the form 'host', 'user@host', or 'user@host/resource'. These differences and established usage are explained more fully below.</p>
|
||||
<section1 topic='Protocol' anchor='protocol'>
|
||||
<p>In order to request last activity information regarding another entity, the requesting entity shall send an &IQ; stanza of type "get" to the target entity, containing a &QUERY; element qualified by the 'jabber:iq:last' namespace:</p>
|
||||
<example caption='Last Activity Query'><![CDATA[
|
||||
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com' type='get' id='last1'>
|
||||
<query xmlns='jabber:iq:last'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The target entity MUST return either an IQ-result or an IQ-error. When returning an IQ-result, the target entity sends an &IQ; stanza of type='result' containing a &QUERY; element with a REQUIRED 'seconds' attribute and OPTIONAL XML character data.</p>
|
||||
<example caption='Last Activity Response'><![CDATA[
|
||||
<iq from='juliet@capulet.com' to='romeo@montague.net/orchard' type='result' id='last1'>
|
||||
<query xmlns='jabber:iq:last' seconds='903'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The requesting entity must interpret the IQ-result based on the responding entity's JID type in order to determine the meaning of the information. Specifically, the information means something different depending on whether the responding entity has a JID of the form 'host', 'user@host', or 'user@host/resource'. These differences are explained more fully below.</p>
|
||||
</section1>
|
||||
<section1 topic='Offline User Query'>
|
||||
<p>As noted above, the primary usage of the 'jabber:iq:last' namespace is to find out how long ago a user logged out (and, additionally, what their status message was at that time). This primary usage assumes that the IQ get is sent to (and the IQ reply is received from) a JID of the form 'user@host'. When used in this way, the <query> element contained in the IQ reply has a 'seconds' attribute, which is the number of seconds that have passed since the user last logged out, and the element CDATA is the status message of the last unavailable presence received from the user. An example is shown below:</p>
|
||||
<example caption='Offline User Last Query'><![CDATA[
|
||||
<iq id='l4' type='get' to='user@host'>
|
||||
<section1 topic='Offline User Query' anchor='offline'>
|
||||
<p>The primary usage of the 'jabber:iq:last' namespace is to find out how long ago a user logged out (and, additionally, what their status message was at that time). This primary usage assumes that the IQ-get is sent to a bare JID (&BAREJID;). When used in this way, the &QUERY; element contained in the IQ-result has a 'seconds' attribute, which is the number of seconds that have passed since the user last logged out. In addition, the element MAY contain XML character data that specifies the status message of the last unavailable presence received from the user. An example is shown below:</p>
|
||||
<example caption='Last Activity Query'><![CDATA[
|
||||
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com' type='get' id='last1'>
|
||||
<query xmlns='jabber:iq:last'/>
|
||||
</iq>
|
||||
|
||||
<iq id='l4' type='result' from='user@host'>
|
||||
<query xmlns='jabber:iq:last' seconds='903'>
|
||||
Heading home
|
||||
</query>
|
||||
<iq from='juliet@capulet.com' to='romeo@montague.net/orchard' type='result' id='last1'>
|
||||
<query xmlns='jabber:iq:last' seconds='903'>Heading Home</query>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>In this example, the user logged out fifteen minutes and three seconds ago, and when they logged out they sent a presence packet of type='unavailable' whose <status/> element contained the text "Heading home".</p>
|
||||
<p>In this example, the user logged out fifteen minutes and three seconds ago, and when they logged out they sent a presence packet of type='unavailable' whose <status/> element contained the text "Heading Home".</p>
|
||||
<p>If the user has at least one available resource when the server receives the request, the response SHOULD contain an empty <query/> element whose 'seconds' attribute is set to a value of '0'.</p>
|
||||
<p>Note well that, as specified in &xmppcore; and &xmppim;, an IQ query sent to a JID of the form user@host is handled by a server on the user's behalf, not forwarded to one or more active resources. In addition, a server MUST NOT return last activity information to an entity that is not authorized to view the user's presence information (normally via presence subscription), and MUST return a "Forbidden" error in response to such a request (for information about error conditions, refer to &xep0086;).</p>
|
||||
</section1>
|
||||
<section1 topic='Online User Query'>
|
||||
<p>When the IQ get in the 'jabber:iq:last' namespace is sent to a specific resource of an online user (i.e., a JID of the form of 'user@host/resource'), the JID sending the reply MAY respond with the idle time of the user. This is not a required protocol for clients to support, so clients sending such requests MUST NOT depend on receiving a meaningful result from the target user (although a client that does not support the protocol, or that does not wish to divulge this information, SHOULD return a "Service Unavailable" error). The standard does not specify what resolution the clients must use for the idle times, so the result SHOULD NOT be used as a precise measurement. Here is an example:</p>
|
||||
<example caption='Online User Last Query'><![CDATA[
|
||||
<iq id='l67' type='get' to='user@host/resource'>
|
||||
<section1 topic='Online User Query' anchor='online'>
|
||||
<p>When the IQ-get is sent to a full JID (&FULLJID;), the responding entity MAY respond with the idle time of the user.</p>
|
||||
<example caption='Online User Last Query'><![CDATA[
|
||||
<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' type='get' id='last2'>
|
||||
<query xmlns='jabber:iq:last'/>
|
||||
</iq>
|
||||
|
||||
<iq id='l67' type='result' from='user@host/resource'>
|
||||
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='result' id='last2'>
|
||||
<query xmlns='jabber:iq:last' seconds='123'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>In this example, the user has been idle for about two minutes.</p>
|
||||
<p>Support for this functionality is OPTIONAL (a client that does not support the protocol, or that does not wish to divulge this information, SHOULD return a &unavailable; error).</p>
|
||||
<example caption='Service Unavailable Error'><![CDATA[
|
||||
<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='error' id='last2'>
|
||||
<query xmlns='jabber:iq:last'/>
|
||||
<error code='503' type='cancel'>
|
||||
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
</error>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>If there is no available resource matching the user@host/resource in the 'to' attribute of the request, the server MUST follow the rules in <strong>XMPP IM</strong> in order to determine what error stanza to return.</p>
|
||||
</section1>
|
||||
<section1 topic='Server and Component Query'>
|
||||
<p>When the IQ get in the 'jabber:iq:last' namespace is sent to a server or component (i.e., to a JID of the form 'host'), the information contained in the IQ reply reflects the uptime of the JID sending the reply. The seconds attribute is how long the host has been up, and the CDATA is unused.</p>
|
||||
<section1 topic='Server and Component Query' anchor='server'>
|
||||
<p>When the IQ-get namespace is sent to a server or component (i.e., to a JID of the form 'host'), the information contained in the IQ reply reflects the uptime of the JID sending the reply. The seconds attribute is how long the host has been up. The &QUERY; element SHOULD NOT contain XML character data.</p>
|
||||
<example caption='Server/Component Last Query'><![CDATA[
|
||||
<iq id='l5' type='get' to='server'>
|
||||
<iq from='romeo@montague.net/orchard' to='capulet.com' type='get' id='last3'>
|
||||
<query xmlns='jabber:iq:last'/>
|
||||
</iq>
|
||||
|
||||
<iq id='l5' type='result' from='server'>
|
||||
<iq from='capulet.com' to='romeo@montague.net/orchard' type='result' id='last3'>
|
||||
<query xmlns='jabber:iq:last' seconds='123456'/>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>In this example, the server has been up for a little more than 34 hours.</p>
|
||||
</section1>
|
||||
<section1 topic='Security Considerations'>
|
||||
<p>A server MUST NOT allow an unauthorized entity to learn a user's network availability by sending a Last Activity request to a JID of the form user@host or user@host/resource; Last Activity information MAY be divulged only to those entities that have permission to view the user's presence (normally via presence subscription), potentially as restricted by privacy rules (as defined in <strong>XMPP IM</strong> and further profiled in &xep0126;).</p>
|
||||
<section1 topic='Implementation Notes' anchor='impl'>
|
||||
<p>The information contained in an IQ reply for this namespace is inherently aambiguous. Specifically, for a bare JID (&BAREJID;) the information is the time since the JID was last connected to its server; for a full JID (&FULLJID;) the information is the time since the resource was last active in the context of an existing session; and for a bare domain the information is the uptime for the server or component. An application must take these differences into account when presenting the information to a human user.</p>
|
||||
</section1>
|
||||
<section1 topic='IANA Considerations'>
|
||||
<section1 topic='Security Considerations' anchor='security'>
|
||||
<p>A server MUST NOT allow an unauthorized entity to learn a user's network availability by sending a Last Activity request to a JID of the form user@host or user@host/resource; i.e., Last Activity information MAY be divulged only to those entities that have permission to view the user's presence via a presence subscription (potentially as restricted by &xep0016; or &xep0191;).</p>
|
||||
<p>A client MUST provide a way for a human user to disable sending of Last Activity responses from the client's full JID (&FULLJID;).</p>
|
||||
</section1>
|
||||
<section1 topic='IANA Considerations' anchor='iana'>
|
||||
<p>This document requires no interaction with &IANA;.</p>
|
||||
</section1>
|
||||
<section1 topic='XMPP Registrar Considerations'>
|
||||
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
||||
<p>No action on the part of the ®ISTRAR; is necessary as a result of this document, since 'jabber:iq:last' is already a registered protocol namespace.</p>
|
||||
</section1>
|
||||
<section1 topic='XML Schema'>
|
||||
<section1 topic='XML Schema' anchor='schema'>
|
||||
<code><![CDATA[
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
@ -151,9 +178,4 @@
|
||||
</xs:schema>
|
||||
]]></code>
|
||||
</section1>
|
||||
<section1 topic='Future Considerations'>
|
||||
<p>The 'jabber:iq:last' namespace has been used intensively (in the jabberd server, components such as most transports, and some Jabber clients), and no major faults have been found in the current implementations. However, as noted, it has not necessarily been used widely, and many Jabber clients lack support for this namespace. For this reason it is probably best to consider it a non-core namespace.</p>
|
||||
<p>The current specification assumes that the 'resource' portion of a JID is equivalent to a device or connection (laptop, PDA, etc.). While in that context it makes sense to interpret the information returned by an IQ reply in the 'jabber:iq:last' namespace as client idle time, such an assumption will make less sense in a future world where a resource may be not a device or connection but truly a more generic resource such as a calendar or weblog. The current interpretation of 'jabber:iq:last' for 'user@host/resource' as idle time may not be appropriate for the more diverse Jabber resources of the future.</p>
|
||||
<p>The most significant point of contention regarding the 'jabber:iq:last' namespace is the perceived ambiguity of the information contained in an IQ reply for this namespace. Specifically, for a 'user@host' the information is the time since the JID was last connected to the host, for a 'user@host/resource' the information is the time since the resource was last active (i.e., in most circumstances the client idle time), and for a 'host' the information is the uptime for the server or component. Because of this ambiguity (real or perceived), there is some sentiment in the Jabber community that it would be better to create a separate 'jabber:iq:uptime' namespace (and perhaps even a 'jabber:iq:idletime' namespace), leaving the 'jabber:iq:last' namespace for last disconnection time only. These potential namespaces may be proposed in one or more future specifications if needed.</p>
|
||||
</section1>
|
||||
</xep>
|
||||
|
Loading…
Reference in New Issue
Block a user