mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user