I'm using this code to get the presence status of a user
Roster roster = connection.getRoster();
Presence userPresence = roster.getPresence(name + "@" + HOST);
But userPresence
always returns "unavailable"
although the user is online.
So what am I doing wrong, How can I get the presence status of a user?