Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Jean #1
Member since Sep 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Presence Type from two different clients
Hi,
I started using agsxmpp about a year back. Now when I revisit the code I wrote,I have a peculiar problem. So here is the situation ...

I log in using my client based on agxmpp, where MyFriend has already logged in from two different clients : ClientA with Showtype "Available" and ClientB with Showtype "Away"

here is what I mean : (from ClientA)

{<presence xmlns="jabber:client" from="abc@xyz.com/ClientA.v1012121" to="me@myserver.com/Myclient"><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" ver="1.0.0.104" node="http://www.xyz.com/xmpp/client/caps" ext="share-v1 voice-v1" /><x xmlns="jabber:x:delay" stamp="20091108T07:11:24" /><status /><x xmlns="vcard-temp:x:update"><photo>246525425245245245245243525245245245</photo></x></presence>}


(from ClientB)
{<presence xmlns="jabber:client" from="abc@xyz.com/ClientB.v301621" to="me@myserver.com/Myclient"><priority>24</priority><c xmlns="http://jabber.org/protocol/caps" ver="1.0.0.104" node="http://www.xyz.com/xmpp/client/caps" ext="share-v1 voice-v1" /><x xmlns="jabber:x:delay" stamp="20091108T07:11:26" /><status /><x xmlns="vcard-temp:x:update"><photo>246525425245245245245243525245245245</photo></x></presence>}

Now The roster will update the Friend's status as well as the Showtype twice, and will show the later one on the form as the "actual" status to me.  Now for example if MyFriend logs out from ClientB (presence type unavailable), he will be removed from my roster(acc to my chat client's logic). But he is online via ClientA.. What sould be done to contain this problem. This is a headache specially with Google Chat, where they send Presence.unavailable to invisible mode. So if the user gets invisible(which I dont like too), and remains online from another client, he is considered offline!

Hope you understand the situation :)

Thanks.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
hi Jean,

this is one of the features of XMPP. You can login with one user id multiple times to a server. Only the resource must be different.
I agree that this is hard for client developers sometimes, because you need a good logic to show and aggregate the presences. There are many different solutions for this scenario, and if you look at existing clients then they all do it different.

  • Some show the presence of each resource
  • Others aggregate the presence using a special logic and the priority

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS