[ejabberd] getting last activity of a user from ejabberd server

Badlop badlop at gmail.com
Sat Jan 9 15:24:26 MSK 2010

2010/1/9 Tharindu Madushanka <tharindufit at gmail.com>:
> I was trying to get Last Activity information for a jabber contact from
> roster ( xep-0012 ).
> ( I want to know whether that user is online

If you are subscribed to the contact presence, you already get
presence from that contact. And also you know what resource he is
logged in.

> or how long ago he was online)

Ask last activity to his connected resource, and his client will
decide if it provides you last activity or an error.

> But even when that user is online.. I am getting a
> value as seconds.. which was when that contact was last seen online..

Right, ejabberd doesn't implement this part of the XEP:

> If the user has at least one connected or available resource when the server
> receives the request, the response MUST (subject to local security policies)
> contain an empty <query/> element whose 'seconds' attribute is set to a value
> of '0'.



More information about the ejabberd mailing list