I am creating a facebook chat client using asmack library. Creating a connection, retrieval of contacts, establishing a chat, everything goes fine. However, when a user goes offline, it takes a while (about a minute or so) before my
presenceChanged
method in the RosterListener is executed. When a user goes online, presenceChanged method is executed almost immediately. Code I am using is just a simple RosterListener:
roster.addRosterListener(new RosterListener() {
// Ignored events
public void entriesAdded(Collection addresses) {}
public void entriesDeleted(Collection addresses) {}
public void entriesUpdated(Collection addresses) {}
public void presenceChanged(Presence presence) {
//do something to add/remove contact from list
} });
Is this something Facebook related? Or Smack related? Is there any workaround for this?