From 3360752c5cacdb33ccf1d48abde9826db3c4f7a5 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Wed, 3 Sep 2014 11:42:28 -0500 Subject: [PATCH] Added action:post.downvote hook --- src/favourites.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/favourites.js b/src/favourites.js index cb4de2e97e..741d3a3c4f 100644 --- a/src/favourites.js +++ b/src/favourites.js @@ -131,7 +131,14 @@ var async = require('async'), return callback(new Error('[[error:not-enough-reputation-to-downvote]]')); } - toggleVote('downvote', pid, uid, callback); + toggleVote('downvote', pid, uid, function(err, votes) { + if (err) return callback(err); + plugins.fireHook('action:post.downvote', { + pid: pid, + uid: uid + }); + callback(null, votes); + }); }); };