a bit more integration for #6463

This commit is contained in:
Julian Lam
2018-04-20 13:49:23 -04:00
parent bfee23adee
commit a367b698e3
4 changed files with 31 additions and 4 deletions

View File

@@ -254,6 +254,17 @@ function pushToUids(uids, notification, callback) {
}
async.waterfall([
function (next) {
// Remove uid from recipients list if they have blocked the user triggering the notification
async.filter(uids, function (uid, next) {
User.blocks.is(notification.from, uid, function (err, blocked) {
next(err, !blocked);
});
}, function (err, _uids) {
uids = _uids;
next(err);
});
},
function (next) {
plugins.fireHook('filter:notification.push', { notification: notification, uids: uids }, next);
},