Question

I'm using libpurple to connect to the FB chat. The problem is that I do not get online presences from friends who are online the via mobile Facebook application.

But if such a friend sends me a message, I get both the message and online presence for him at the same time.

It looks like this:

(14:23:08) jabber: Recv (ssl)(191): <message from="-mybyddyid@chat.facebook.com"     to="myownid@chat.facebook.com/b94353f3_4CE87B53BB319" type="chat"><composing  xmlns="http://jabber.org/protocol/chatstates"/></message>

(14:23:10) jabber: Recv (ssl)(188): <message from="-mybyddyid@chat.facebook.com"   to="myownid@chat.facebook.com/b94353f3_4CE87B53BB319" type="chat"><active   xmlns="http://jabber.org/protocol/chatstates"/></message>

(14:23:11) jabber: Recv (ssl)(166): <presence from="-mybyddyid@chat.facebook.com" to="myownid@chat.facebook.com/b94353f3_4CE87B53BB319"><x xmlns="vcard-temp:x:update"><photo/></x></presence>

So I am wondering whether it's my fault or the limitation Facebook Chat implementation.

Was it helpful?

Solution

I think there will be a delay for presence updates. Maybe you can check this out asking your friends not to send a message and waiting for the presence to change. From the facebook chat developers page [1] it seems that there will be a delay after which the presence will get updated when you change it.

Also, from the same page, one of the limitations is that the facebook chat server doesn't support presence probes. An XMPP server sends presence probes to contacts if it doesn't already have the presence information of the contacts after the user logs in and sends the initial presence (see section 5.1.1 of RFC 3921 [2], and section 4.3.1 of RFC 6121 [3]).

If the server cant send presence probes, it may not have the presence information of the contacts. I dont know how the facebook chat server was implemented, but I am guessing that when the contact does something (like sending a message/updating the presence), the server assumes that the contact is online and sends the presence. (I may be wrong here, someone correct me if I am!)

References:

[1] http://developers.facebook.com/docs/chat/

[2] http://xmpp.org/rfcs/rfc3921.html

[3] http://xmpp.org/rfcs/rfc6121.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top