public boolean shouldBlockPacket(Packet packet) {
        if (packet.getFrom() == null) {
            // Sender is the server so it's not denied
            return false;
        }
        // Iterate over the rules and check each rule condition
        Roster roster = getRoster();
        for (PrivacyItem item : items) {
            if (item.matchesCondition(packet, roster, userJID)) {
                if (item.isAllow()) {
                    return false;
                }
                if (Log.isDebugEnabled()) {
                    Log.debug("PrivacyList: Packet was blocked: " + packet);
                }
                return true;
            }
        }
        // If no rule blocked the communication then allow the packet to flow
        return false;
    }
Returns true if the specified packet must be blocked based on this privacy list rules.
Rules are going to be analyzed based on their order (in ascending order). When a rule
is matched then communication will be blocked or allowed based on that rule. No more
further analysis is going to be made.

@param packet the packet to analyze if it must be blocked.
@return true if the specified packet must be blocked based on this privacy list rules.
xmppserver/src/main/java/org/jivesoftware/openfire/privacy/PrivacyList.java