This commit is contained in:
Barış Soner Uşaklı
2018-04-22 09:10:02 -04:00
parent bb3f98eb05
commit 6659a520e0
4 changed files with 53 additions and 55 deletions

View File

@@ -4,7 +4,7 @@ var async = require('async');
var meta = require('../../meta');
var emailer = require('../../emailer');
var plugins = require('../../plugins');
var notifications = require('../../notifications');
var settingsController = module.exports;
@@ -45,32 +45,12 @@ function renderEmail(req, res, next) {
}
function renderUser(req, res, next) {
var types = [
'notificationType_upvote',
'notificationType_new-topic',
'notificationType_new-reply',
'notificationType_follow',
'notificationType_new-chat',
'notificationType_group-invite',
];
var privilegedTypes = [
'notificationType_new-register',
'notificationType_post-queue',
'notificationType_new-post-flag',
'notificationType_new-user-flag',
];
async.waterfall([
function (next) {
plugins.fireHook('filter:user.notificationTypes', {
userData: {},
types: types,
privilegedTypes: privilegedTypes,
}, next);
notifications.getAllNotificationTypes(next);
},
function (results) {
var notificationSettings = results.types.concat(results.privilegedTypes).map(function (type) {
function (notificationTypes) {
var notificationSettings = notificationTypes.map(function (type) {
return {
name: type,
label: '[[notifications:' + type + ']]',