mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	chore: found some hooks that don't play well docgen
This commit is contained in:
		@@ -353,7 +353,7 @@ define('forum/topic/postTools', [
 | 
			
		||||
				return app.alertError(err);
 | 
			
		||||
			}
 | 
			
		||||
			var type = method === 'put' ? 'bookmark' : 'unbookmark';
 | 
			
		||||
			hooks.fire('action:post.' + type, { pid: pid });
 | 
			
		||||
			hooks.fire(`action:post.${type}`, { pid: pid });
 | 
			
		||||
		});
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -82,8 +82,8 @@ module.exports = function (Groups) {
 | 
			
		||||
 | 
			
		||||
		const set = type === 'invite' ? `group:${groupName}:invited` : `group:${groupName}:pending`;
 | 
			
		||||
		await db.setAdd(set, uids);
 | 
			
		||||
		const hookName = type === 'invite' ? 'action:group.inviteMember' : 'action:group.requestMembership';
 | 
			
		||||
		plugins.hooks.fire(hookName, {
 | 
			
		||||
		const hookName = type === 'invite' ? 'inviteMember' : 'requestMembership';
 | 
			
		||||
		plugins.hooks.fire(`action:group.${hookName}`, {
 | 
			
		||||
			groupName: groupName,
 | 
			
		||||
			uids: uids,
 | 
			
		||||
		});
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,8 @@ module.exports = function (Plugins) {
 | 
			
		||||
			await db.sortedSetAdd('plugins:active', count, id);
 | 
			
		||||
		}
 | 
			
		||||
		meta.reloadRequired = true;
 | 
			
		||||
		Plugins.hooks.fire(isActive ? 'action:plugin.deactivate' : 'action:plugin.activate', { id: id });
 | 
			
		||||
		const hook = isActive ? 'deactivate' : 'activate';
 | 
			
		||||
		Plugins.hooks.fire(`action:plugin.${isActive}`, { id: id });
 | 
			
		||||
		return { id: id, active: !isActive };
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,8 @@ module.exports = function (Topics) {
 | 
			
		||||
		}
 | 
			
		||||
		const canDelete = await privileges.topics.canDelete(tid, uid);
 | 
			
		||||
 | 
			
		||||
		const data = await plugins.hooks.fire(isDelete ? 'filter:topic.delete' : 'filter:topic.restore', { topicData: topicData, uid: uid, isDelete: isDelete, canDelete: canDelete, canRestore: canDelete });
 | 
			
		||||
		const hook = isDelete ? 'delete' : 'restore';
 | 
			
		||||
		const data = await plugins.hooks.fire(`filter:topic.${hook}`, { topicData: topicData, uid: uid, isDelete: isDelete, canDelete: canDelete, canRestore: canDelete });
 | 
			
		||||
 | 
			
		||||
		if ((!data.canDelete && data.isDelete) || (!data.canRestore && !data.isDelete)) {
 | 
			
		||||
			throw new Error('[[error:no-privileges]]');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user