public boolean isPresenceBasedDelivery(JID user) {
        Collection<NodeSubscription> subscriptions = getSubscriptions(user);
        if (!subscriptions.isEmpty()) {
            if (presenceBasedDelivery) {
                getLogger().trace("Notifications to '{}' will be delivered when the user is online. User has subscriptions, and node is configure for presence-based delivery.", user);
                // Node sends notifications only to only users so return true
                return true;
            }
            else {
                // Check if there is a subscription configured to only send notifications based on the user presence
                for (NodeSubscription subscription : subscriptions) {
                    if (!subscription.getPresenceStates().isEmpty()) {
                        getLogger().trace("Notifications to '{}' will be delivered when the user is online. User has subscriptions of which at least one is presence-based.", user);
                        return true;
                    }
                }
            }
        }
        //
        getLogger().trace("Notifications to '{}' will NOT be delivered when the user is online. User is not subscribed to the node.", user);
        return false;
    }
Returns true if notifications to the specified user will be delivered when the
user is online.

@param user the JID of the affiliate that has to be subscribed to the node.
@return true if notifications are going to be delivered when the user is online.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java