Change user.delete hook from action to filter

The user.delete hook is now a filter, giving plugins a chance to access
the user's data before it's deleted from Redis.
v1.18.x
dhingey 11 years ago
parent 5b6acbad1e
commit 9d45373b59

@ -121,6 +121,9 @@ Executed when a post or signature needs to be parsed from raw text to HTML (for
``filter:user.create``
^^^^^^^^^^^^^^^^^^^^^
``filter:user.delete``
^^^^^^^^^^^^^^^^^^^^^
``filter:user.profileLinks``
^^^^^^^^^^^^^^^^^^^^^
@ -225,9 +228,6 @@ Executed whenever a notification is pushed to a user.
``action:user.create``
^^^^^^^^^^^^^^^^^^^^^
``action:user.delete``
^^^^^^^^^^^^^^^^^^^^^
``action:topic.delete``
^^^^^^^^^^^^^^^^^^^^^

@ -106,13 +106,15 @@ module.exports = function(User) {
},
function(next) {
groups.leaveAllGroups(uid, next);
},
function(next) {
plugins.fireHook('filter:user.delete', uid, next);
}
], function(err) {
if (err) {
return callback(err);
}
plugins.fireHook('action:user.delete', uid);
async.parallel([
function(next) {
db.delete('followers:' + uid, next);

Loading…
Cancel
Save