mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
refactor: move plugin hook methods to plugin.hooks.*
This commit is contained in:
@@ -128,7 +128,7 @@ usersAPI.changePassword = async function (caller, data) {
|
||||
|
||||
usersAPI.follow = async function (caller, data) {
|
||||
await user.follow(caller.uid, data.uid);
|
||||
plugins.fireHook('action:user.follow', {
|
||||
plugins.hooks.fire('action:user.follow', {
|
||||
fromUid: caller.uid,
|
||||
toUid: data.uid,
|
||||
});
|
||||
@@ -151,7 +151,7 @@ usersAPI.follow = async function (caller, data) {
|
||||
|
||||
usersAPI.unfollow = async function (caller, data) {
|
||||
await user.unfollow(caller.uid, data.uid);
|
||||
plugins.fireHook('action:user.unfollow', {
|
||||
plugins.hooks.fire('action:user.unfollow', {
|
||||
fromUid: caller.uid,
|
||||
toUid: data.uid,
|
||||
});
|
||||
@@ -185,7 +185,7 @@ usersAPI.ban = async function (caller, data) {
|
||||
ip: caller.ip,
|
||||
reason: data.reason || undefined,
|
||||
});
|
||||
plugins.fireHook('action:user.banned', {
|
||||
plugins.hooks.fire('action:user.banned', {
|
||||
callerUid: caller.uid,
|
||||
ip: caller.ip,
|
||||
uid: data.uid,
|
||||
@@ -207,7 +207,7 @@ usersAPI.unban = async function (caller, data) {
|
||||
targetUid: data.uid,
|
||||
ip: caller.ip,
|
||||
});
|
||||
plugins.fireHook('action:user.unbanned', {
|
||||
plugins.hooks.fire('action:user.unbanned', {
|
||||
callerUid: caller.uid,
|
||||
ip: caller.ip,
|
||||
uid: data.uid,
|
||||
@@ -278,7 +278,7 @@ async function processDeletion({ uid, method, password, caller }) {
|
||||
|
||||
sockets.server.sockets.emit('event:user_status_change', { uid: caller.uid, status: 'offline' });
|
||||
|
||||
plugins.fireHook('action:user.delete', {
|
||||
plugins.hooks.fire('action:user.delete', {
|
||||
callerUid: caller.uid,
|
||||
uid: uid,
|
||||
ip: caller.ip,
|
||||
|
||||
Reference in New Issue
Block a user