1.1.3 beta 2 is available here!.
Hi Daniel, After some tests I found that every time when kraken sent the probe package in function syncUsers the chat.facebook.com closes the connection. It looks like the fb server doesn't like presence package with from and to, which means Local server distributes on behalf of the client. So what we need is only sending a simple presence without from and to, then all works. |
|||








Re: I found why facebook xmpp not working
Huh! I wonder if I'm sending an incorrect probe packet then? Or if Facebook's XMPP isn't fully implementing the specs. Great detective work! =D
I'm 90% sure that at least one other server required that to be set. So there's a chance I might have to put a toggle flag in there depending on what type of connection it is. (bah!) I'll try some simple tweaks first but thanks for putting me in the right direction!
Re: I found why facebook xmpp not working
I think it's a problem of fb's server. I remember in somewhere it's said that fb xmpp server don't allow gateway server login in on behalf of user, but I really cannot find that page right now.
The following is the code I have, it works fine with me, FYI.
public void syncUsers() {
for (RosterEntry entry : conn.getRoster().getEntries()) {
getBuddyManager().storeBuddy(new XMPPBuddy(getBuddyManager(), entry.getUser(), entry.getName(), entry.getGroups(), entry));
if (!getTransport().getType().equals(TransportType.facebook)) {
ProbePacket probe = new ProbePacket(this.getJID()+"/"+xmppResource, entry.getUser());
Log.debug("XMPP: Sending the following probe packet: "+probe.toXML());
try {
conn.sendPacket(probe);
}
catch (IllegalStateException e) {
Log.debug("XMPP: Not connected while trying to send probe.");
}
}
}
if (getTransport().getType().equals(TransportType.facebook)) {
Presence p = new Presence(Type.available);
try {
conn.sendPacket(p);
}
catch (IllegalStateException e) {
Log.debug("XMPP: Not connected while trying to send presense for facebook.");
}
}
try {
getTransport().syncLegacyRoster(getJID(), getBuddyManager().getBuddies());
}
catch (UserNotFoundException ex) {
Log.error("XMPP: User not found while syncing legacy roster: ", ex);
}
getBuddyManager().activate();
}
cheer!
Re: I found why facebook xmpp not working
Great job, Man. Very useful fix for us.
Thanks!
Re: I found why facebook xmpp not working
Howdy! Ok I no longer get immediately logged out from Facebook, but the original problem is still there that I was trying to address so I'm working on that atm.