%ents; ]>
Last Activity in Presence This specification defines a way to use the Last Activity extension in XMPP presence notifications. &LEGALNOTICE; 0256 Deprecated Standards Track Standards XMPP Core XMPP IM XEP-0012 XEP-0319 N/A &stpeter; 1.1 2009-09-15 psa

Added use case for initial presence.

1.0 2009-05-06 psa

Per a vote of the XMPP Council, advanced specification to Draft.

0.1 2008-11-26 psa

Initial published version; removed note about handling the absence of a last activity notation; added security considerations.

0.0.1 2008-11-20 psa

Rough draft based on list discussion.

&xep0012; defines a method for determining the last time that an XMPP entity was active. This document specifies that an online client MAY include last activity information when sending a presence update. Including such information essentially means "when I sent this presence notification I had last been active at time T".

There are two primary use cases:

  1. When a client sends initial presence to start a presence session, the last activity notation indicates when that client terminated its previous presence session.
  2. When a client changes from available to "away" or "xa", the last activity notation indicates when that client was last active during the current presence session.

The following sections show examples of each use case.

When a client begins a presence session, it can indicate when that particular client was last online. It does this by sending initial presence with a last activity notation.

]]>

This can be read as "I'm now online and I was last online at this client 24 hours and 111 seconds ago".

Including last activity information in an initial presence notification enables &xep0060; and &xep0163; nodes to optimize item delivery (e.g., by sending only the items that were published after a subscriber went offline the last time) and enables &xep0045; rooms to optimize the delivery of discussion history messages.

When a client automatically sets the user's &SHOW; value to "away" or "xa" (extended away), it can indicate when that particular was last active during the current presence session.

away ]]>

This can be read as "I just went away and I was last active 10 minutes ago".

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 ]]>

Including a last activity notation in presence notifications can enable those who receive such notifications to determine exactly when a user has stopped interacting with his or her XMPP client, but this information is in essence already available if the user publishes timely presence updates. Therefore, this specification introduces no new vulnerabilities.

This document requires no interaction with &IANA;.

This document requires no interaction with the ®ISTRAR;.