Uniform action:post.* hook

v1.18.x
Andrea Cardinale 10 years ago
parent 423c6cc0ec
commit 92c1d6712b

@ -270,6 +270,9 @@ var async = require('async'),
var isFavouriting = type === 'favourite'; var isFavouriting = type === 'favourite';
async.parallel({ async.parallel({
owner: function(next) {
posts.getPostField(pid, 'uid', next);
},
postData: function(next) { postData: function(next) {
posts.getPostFields(pid, ['pid', 'uid'], next); posts.getPostFields(pid, ['pid', 'uid'], next);
}, },
@ -312,9 +315,13 @@ var async = require('async'),
return callback(err); return callback(err);
} }
var current = results.hasFavourited ? 'favourited' : 'unfavourited';
plugins.fireHook('action:post.' + type, { plugins.fireHook('action:post.' + type, {
pid: pid, pid: pid,
uid: uid, uid: uid,
owner: results.owner,
current: current
}); });
callback(null, { callback(null, {

Loading…
Cancel
Save