deprecating old hook for #5232

v1.18.x
Julian Lam 8 years ago
parent 5dd892bd01
commit a5fb4825b4

@ -6,7 +6,7 @@
"popular-month": "Popular topics this month",
"popular-alltime": "All time popular topics",
"recent": "Recent Topics",
"flagged-posts": "Flagged Posts",
"flagged-content": "Flagged Content",
"ip-blacklist": "IP Blacklist",
"users/online": "Online Users",

@ -597,7 +597,9 @@ Flags.notify = function (flagObj, uid, callback) {
return callback(err);
}
plugins.fireHook('action:post.flag', {post: results.post, reason: flagObj.description, flaggingUser: flagObj.reporter});
plugins.fireHook('action:flag.create', {
flag: flagObj
});
notifications.push(notification, results.admins.concat(results.moderators).concat(results.globalMods), callback);
});
});
@ -624,6 +626,9 @@ Flags.notify = function (flagObj, uid, callback) {
return callback(err);
}
plugins.fireHook('action:flag.create', {
flag: flagObj
});
notifications.push(notification, results.admins.concat(results.globalMods), callback);
});
});

@ -7,7 +7,8 @@ module.exports = function (Plugins) {
Plugins.deprecatedHooks = {
'filter:user.custom_fields': null, // remove in v1.1.0
'filter:post.save': 'filter:post.create',
'filter:user.profileLinks': 'filter:user.profileMenu'
'filter:user.profileLinks': 'filter:user.profileMenu',
'action:post.flag': 'action:flag.create'
};
/*
`data` is an object consisting of (* is required):

Loading…
Cancel
Save