How to implement "last seen at" functionality (like whatsapp) in XMPP? -


i working on chat application , want add "last seen at" functionality. trying implement using presence stanzas getting 1 issue, please check @ below link

not getting unavailable presence of user when user b unavailable

is there other way implement last seen @ functionality

please suggest

the first google result "xmpp last seen" xep-0012: last activity, protocol extension can used find out when user online last time.

you send request this:

<iq from='romeo@montague.net/orchard'      id='last1'     to='juliet@capulet.com'     type='get'>   <query xmlns='jabber:iq:last'/> </iq> 

and response this:

<iq from='juliet@capulet.com'      id='last1'     to='romeo@montague.net/orchard'     type='result'>   <query xmlns='jabber:iq:last' seconds='903'/> </iq> 

which means contact last online 903 seconds ago. subtract current time "last seen" timestamp.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -