igniterealtime/openfire-pushnotification-plugin

Do not push when sender is on privacy list

guusdk opened this issue · 1 comments

When the sender of a message is being blocked by the intended recipient, push notifications should not be sent.

At the very least, this scenario needs to be tested (and likely, requires fixing).

Pseudo-code contributed by original reporter (needs to be modified for messages):

PrivacyList list = PrivacyListManager.getInstance().getDefaultPrivacyList(probee.getNode());
// Send presence to all prober's resources
for (JID receipient : proberFullJIDs) {
    presencePacket.setTo(receipient);
    if (list == null || !list.shouldBlockPacket(presencePacket)) {
        // Send the presence to the prober
        deliverer.deliver(presencePacket);
    }
}