I use the code above to determine available persons in the roster (I stripped the code here a little bit).
It is working great … most time, but sometimes it just says that the presence of some user could not be determined (which worked a few minutes before perfectly).
Any Help ??
Roster roster = xmppCon.getRoster();
RosterEntry entry;
for (Iterator i=roster.getEntries(); i.hasNext(); ) {
entry = (RosterEntry)i.next();
if (roster.getPresence(entry.getUser()) != null && roster.getPresence(entry.getUser()).getType() == Presence.Type.AVAILABLE) {
debug.writeDebugLog ("Request send to " + entry.getUser());
}
} else
if (roster.getPresence(entry.getUser()) != null)
debug.writeDebugLog (entry.getUser() + " is not available");
else
debug.writeDebugLog (entry.getUser() + " could not determine presence");
} // END -> for (Iterator i=roster.getEntries(); i.hasNext(); )
I’'ve implemented your code but the problem still remains
Edit:
I’'ve got the following scenario right now:
I’'ve opened one bot over my local adresse and another over mine dyndns-domain. The first bot only could determine the presence of one user, the other of both of my logins.
Sometimes it’'s just the other way. this is realy driving me crazy ^^.
(A spell check function, when editing a post, would be nice)