powered by Jive Software

Help with presence stanza

Hi,

Is there a tip for a client to distinguish a contact already connected

when the client connects and a contact that will be connect after client’s has

connected.

It seems, for an already connected contact, that the server sends a “presence”

stanza with a

x element with a stamp attribute:

<presence to=‘MyClientJabberId’ from=‘AContactJabberId’>

<priority>0</priority>

<status>TheContactStatus</status>

<x stamp=‘20070821T20:42:38’ xmlns=‘jabber:x:delay’/>

</presence>

and when the contacts connects after the client’s connection , the server

sends:

<presence to=‘MyClientJabberId’ from=‘AContactJabberId’>

<priority>0</priority>

<status>TheContactStatus</status>

</presence>

There’s no timestamp.

But its’ seems that some servers and gateways don’t “timestamp” an already

connected contact and so, there’s no way to distinguish the two cases.

Is there a solution ?

You could use the initial roster you retrieve when logging in as a basis to compare.