|
|
|
@ -168,6 +168,25 @@ function favouriteCommand(socket, command, eventName, notification, data, callba
|
|
|
|
|
return callback(new Error('[[error:post-deleted]]'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
hooks:
|
|
|
|
|
filter.post.upvote
|
|
|
|
|
filter.post.downvote
|
|
|
|
|
filter.post.unvote
|
|
|
|
|
filter.post.favourite
|
|
|
|
|
filter.post.unfavourite
|
|
|
|
|
*/
|
|
|
|
|
plugins.fireHook('filter:post.' + command, data, function(err, filteredData) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
executeFavouriteCommand(socket, command, eventName, notification, filteredData, callback);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function executeFavouriteCommand(socket, command, eventName, notification, data, callback) {
|
|
|
|
|
favourites[command](data.pid, socket.uid, function(err, result) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
@ -184,7 +203,6 @@ function favouriteCommand(socket, command, eventName, notification, data, callba
|
|
|
|
|
}
|
|
|
|
|
callback();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SocketPosts.sendNotificationToPostOwner = function(pid, fromuid, notification) {
|
|
|
|
|