mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
Added a hook: action:user.delete
Allows plugins to access the uid of the user being deleted.
This commit is contained in:
@@ -222,6 +222,9 @@ Executed whenever a notification is pushed to a user.
|
|||||||
``action:user.create``
|
``action:user.create``
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
``action:user.delete``
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
``action:topic.delete``
|
``action:topic.delete``
|
||||||
^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ var async = require('async'),
|
|||||||
posts = require('../posts'),
|
posts = require('../posts'),
|
||||||
user = require('../user'),
|
user = require('../user'),
|
||||||
topics = require('../topics'),
|
topics = require('../topics'),
|
||||||
groups = require('../groups');
|
groups = require('../groups'),
|
||||||
|
plugins = require('../plugins');
|
||||||
|
|
||||||
|
|
||||||
module.exports = function(User) {
|
module.exports = function(User) {
|
||||||
@@ -111,6 +112,7 @@ module.exports = function(User) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins.fireHook('action:user.delete', uid);
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
function(next) {
|
||||||
db.delete('followers:' + uid, next);
|
db.delete('followers:' + uid, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user