From ed44aca5e998a1ffcb8028c080f0508a92c2ccca Mon Sep 17 00:00:00 2001 From: Peter Saint-Andre Date: Fri, 14 Nov 2008 23:25:50 +0000 Subject: [PATCH] 1.4rc1: added presence use case git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@2512 4b5297f7-1745-476d-ba37-a9c6900126ab --- xep-0012.xml | 84 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 15 deletions(-) diff --git a/xep-0012.xml b/xep-0012.xml index 7acc4722..c3a61283 100644 --- a/xep-0012.xml +++ b/xep-0012.xml @@ -26,6 +26,12 @@ &jer; &temas; &stpeter; + + 1.4rc1 + 2008-11-13 + psa +

Added use case for inclusion of last activity information in presence.

+
1.3 2008-07-16 @@ -75,13 +81,19 @@

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:

+ ]]>

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.

+ ]]> @@ -90,14 +102,20 @@

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:

+ ]]>

As specified in &xmppcore; and &xmppim;, an IQ stanza of type "get" sent to a bare JID &LOCALBARE; is handled by the user's server on the user's behalf, not delivered to one or more active resources.

If the requesting entity is not authorized to view the user's presence information (normally via a presence subscription as defined in XMPP-IM), the user's server MUST NOT return last activity information but instead MUST return a &forbidden; error in response to the last activity request.

+ @@ -122,7 +140,10 @@

In this case, the user's server shall either deliver the IQ to an available resource or respond on behalf of the user.

In particular, as with the offline query use case above, if the requesting entity is not authorized to view the user's presence information (normally via a presence subscription as defined in XMPP IM), the user's server MUST NOT deliver the IQ-get to an available resource but instead MUST return a &forbidden; error in response to the last activity request.

+ @@ -130,14 +151,20 @@ ]]>

If the user's server delivers the IQ-get to one of the user's available resources, the user's client MAY respond with the idle time of the user (i.e., the last time that the user interacted with the client application).

+ ]]>

In this example, the user has been idle for about two minutes.

Support for this functionality is OPTIONAL. A client that does not support the protocol, or that does not wish to divulge this information, MUST return a &unavailable; error.

+ @@ -145,39 +172,66 @@ ]]>

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 XMPP IM in order to determine what error stanza to return.

+ +

An online client MAY include last activity information when sending presence updates. The prototypical use case is including the idle time when automatically setting the user's &SHOW; value to "away" or "xa" (extended away). For example, consider a user who has configured her client to automatically change her presence to "away" after 10 minutes of inactivity. The client could include an iq:last flag to specify how long the user has been idle.

+ + away + + + ]]> +

If one of the user's contacts receives that presence notification with delayed delivery (see &xep0203;) on login in response to a presence probe as described in &xmppim;, the contact will then know how long the user has been idle (i.e., the number of seconds since the delayed delivery timestamp, plus the iq:last seconds). Thus the contact does not need to send an iq:last query.

+ + away + + + + ]]> +

If no last indication is included in a presence notification, the recipient MUST assume that the idle time is zero.

+

When the last activity query is sent to a server or component (i.e., to a JID of the form &DOMAINBARE;), the information contained in the IQ reply reflects the uptime of the JID sending the reply. The seconds attribute specifies how long the host has been up and running. The &QUERY; element SHOULD NOT contain XML character data.

+ - + ]]>

In this example, the server has been up for a little more than 34 hours.

- -

In order for a requesting entity to determine if a responding entity supports the last activity protocol, it SHOULD send a &xep0030; information request to the responding entity:

+ +

If an entity supports the Last Activity protocol, it MUST advertise that fact in its responses to &xep0030; information ("disco#info") requests by returning a feature of "jabber:iq:last".

+ type='get'> ]]> + type='result'> - ... - ... ]]> +

In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

The information contained in an IQ reply for this namespace is inherently ambiguous. Specifically, for a bare JID &LOCALBARE; the information is the time since the JID was last connected to its server; for a full JID &LOCALFULL; 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.