Presence probes

AFAIK external components should be able to probe the presence of any registered user. However when I try to do this from an externa component I get a forbidden error like this one:

I think I’'ve found the problem here, in the handleProbe method of PresenceManagerImpl:

Roster roster = rosterManager.getRoster(username);

RosterItem item = roster.getRosterItem(packet.getFrom());

if (item.getSubStatus() == RosterItem.SUB_FROM

item.getSubStatus() == RosterItem.SUB_BOTH) {

probePresence(packet.getFrom(), packet.getTo());


else {

PacketError.Condition error = PacketError.Condition.not_authorized;

if ((item.getSubStatus() == RosterItem.SUB_NONE &&

item.getRecvStatus() != RosterItem.RECV_SUBSCRIBE)

(item.getSubStatus() == RosterItem.SUB_TO &&

item.getRecvStatus() != RosterItem.RECV_SUBSCRIBE)) {

error = PacketError.Condition.forbidden;


Presence presenceToSend = new Presence();






Accordingly to this code only users in the roster are allowed to probe presence, instead also components should be able too

Your best bet would be to create an AdHoc command which would return the user’'s presence there are several good examples of AdHoc commands inside of the Wildfire code. I would recommend looking at the GetUsersPresence command specifically.



Indeed that’‘s what I’‘m doing For me there are no problems since I’'m writing the component by myself and I can decide which is the best way to probe presence information.

I was pointing out the problem since there may be other external components relying on this, and it would be annoying to do strange hacks in order to install them