Skip to content

Node.js based forum software built for the modern web

adding notifications.get hook

Julian Lam61deb962e374
diff --git a/src/controllers/accounts/notifications.js b/src/controllers/accounts/notifications.js
index d398003782..3ec4708e7a 100644
--- a/src/controllers/accounts/notifications.js
+++ b/src/controllers/accounts/notifications.js
@@ -75,6 +75,17 @@ notificationsController.get = function (req, res, next) {
user.notifications.getNotifications(nids, req.uid, next);
},
+ function (notifications, next) {
+ plugins.fireHook('filter:notifications.get', {
+ notifications: notifications,
+ }, function (err, data) {
+ if (err) {
+ return next(err);
+ }
+
+ next(null, data.notifications);
+ });
+ },
function (notifications) {
res.render('notifications', {
notifications: notifications,