[jdev] Get Last Activity for myself

Mickaël Rémond mickael.remond at process-one.net
Sat Oct 25 11:24:34 CDT 2008


Hello,

Le 25 oct. 08 à 17:58, Marcus Frenkel a écrit :

> Hi,
>
> I'm developing a jabber client. I'm testing it's functionality against
> ejabberd server.
>
> According to what I understand about Last Activity (XEP-0012), the  
> last
> activity table on the server should contain results only for the bare
> JID, there are no separate records for all JID resources.
>
> When a user logs in I would like to get his last activity status
> message. As you know, the last activity status is set via the presence
> packet of type="unavailable" along with the status message, when a  
> user
> disconnects. I'm unable to get the last activity, the server doesn't
> returns the last activity of myself, it returns "<error code="405"
> type="cancel"> instead. The IQ that I send:
>
> <iq from='myself at host/resource'  to='myself at jhost' type='get' >   
> <query
> xmlns='jabber:iq:last'/></iq>
> or
> <iq from='myself at host'  to='myself at jhost' type='get' >  <query
> xmlns='jabber:iq:last'/></iq>
>
> What I need is when a user connects from another computer to be able  
> to
> get his last activity set by his previous connection.

Last activity on the server is stored the last time a user disconnected.

 From the XEP introduction:
"The canonical usage is to discover when a disconnected user last  
accessed the server."

You thus cannot get the last activity from the server for a user which  
is still connected.

For online users, it is a mostly a client feature (when you use the  
full JID).

-- 
Mickaël Rémond
  http://www.process-one.net/



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20081025/0196b2b3/attachment-0002.htm>


More information about the JDev mailing list