From a5fb4825b4c92a481e7da04246cb307b56f40bd0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 7 Dec 2016 13:06:55 -0500 Subject: [PATCH] deprecating old hook for #5232 --- public/language/en-GB/pages.json | 2 +- src/flags.js | 7 ++++++- src/plugins/hooks.js | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/language/en-GB/pages.json b/public/language/en-GB/pages.json index 801b28edea..104e2249f2 100644 --- a/public/language/en-GB/pages.json +++ b/public/language/en-GB/pages.json @@ -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", diff --git a/src/flags.js b/src/flags.js index 9f121f81bf..bfbe80992a 100644 --- a/src/flags.js +++ b/src/flags.js @@ -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); }); }); diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js index b8e5af0e46..b5a32ba1b7 100644 --- a/src/plugins/hooks.js +++ b/src/plugins/hooks.js @@ -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):