Hello all,
I am trying to create a roster plugin that will display a users roster and the current presence of each roster member.
I am having a problem with the PresenceManager in that it always returns a null Presence.
private String getStatusString(XMPPServer _server, User _user) throws UserNotFoundException {
String presence = null;
String image = null;
JiveGlobals.setProperty("plugin.rosterplugin.public","true");
Log.info("IS IT PUBLIC? " + JiveGlobals.getBooleanProperty("plugin.rosterplugin.public",false));
Presence p = _server.getPresenceManager().getPresence(_user);
Log.info("CAN PROBE=" + String.valueOf(_server.getPresenceManager().canProbePresence(new JID("dufus@myjabber"),"test01")));
if(p == null) {
Log.info("P equals null" + _server.toString() + "///" + _user.getUID());
//Always drops into this block (everyones presence is always null) } else if(p.getShow().equals(Presence.Show.away) {//do something}
Here is the output from the Log.info:
2008.02.04 17:31:02 IS IT PUBLIC? true2008.02.04 17:31:02 CAN PROBE=true2008.02.04 17:31:02 P equals null org.jivesoftware.openfire.XMPPServer@100a289///test02
Any ideas as to what I am doing wrong?
TIA!