private boolean canProbePresence(JID prober, JID probee) throws UserNotFoundException {
        Roster roster;
        roster = XMPPServer.getInstance().getRosterManager().getRoster(prober.getNode());
        RosterItem item = roster.getRosterItem(probee);

        return item.getSubStatus() == RosterItem.SUB_BOTH || item.getSubStatus() == RosterItem.SUB_FROM;
    }
Returns true if the prober is allowed to see the presence of the probee.

@param prober the user that is trying to probe the presence of another user.
@param probee the username of the uset that is being probed.
@return true if the prober is allowed to see the presence of the probee.
@throws UserNotFoundException If the probee does not exist in the local server or the prober
        is not present in the roster of the probee.
xmppserver/src/main/java/org/jivesoftware/openfire/pep/PEPService.java