private boolean matchesPacketSenderCondition(Packet packet, Roster roster, JID userJID) {
        if (type == null) {
            // This is the "fall-through" case
            return true;
        }
        boolean isPresence = packet.getClass().equals(Presence.class);
        boolean incoming = true;
        if (packet.getFrom() != null) {
            incoming = !userJID.toBareJID().equals(packet.getFrom().toBareJID());
        }
        boolean matches = false;
        if (isPresence && !incoming && (filterEverything || filterPresence_out)) {
            // If this is an outgoing presence and we are filtering by outgoing presence
            // notification then use the recipient of the packet in the analysis
            matches = verifyJID(packet.getTo(), roster);
        }
        if (!matches && incoming &&
                (filterEverything || filterPresence_in || filterIQ || filterMessage)) {
            matches = verifyJID(packet.getFrom(), roster);
        }
        return matches;
    }
Returns true if the packet to analyze matches the condition defined by this rule.
Variables involved in the analysis are: type (e.g. jid, group, etc.), value (based
on the type) and granular control that defines which type of packets should be
considered.

@param packet the packet to analyze if matches the rule's condition.
@param roster the roster of the owner of the privacy list.
@param userJID the JID of the owner of the privacy list.
@return true if the packet to analyze matches the condition defined by this rule.
xmppserver/src/main/java/org/jivesoftware/openfire/privacy/PrivacyItem.java