I am working on a chat application and implemented a rosterlistener to get changed presence. But I am getting from all of my rosters presence update.
This is how far I got..
How I change presence:
public void setStatus(boolean available, String status) {
Presence.Type type = available ? Type.available : Type.unavailable;
Presence presence = new Presence(type);
presence.setStatus(status);
connection.sendPacket(presence);
}
How I listen for changing presence:
roster.addRosterListener(new RosterListener() {
public void entriesAdded(Collection<String> param) {
}
public void entriesDeleted(Collection<String> addresses) {
}
public void entriesUpdated(Collection<String> addresses) {
}
public void presenceChanged(Presence presence) {
/* Do something when presence changed */
});
Is there a way to send presence change like status only for selected rosters ?