mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	Rename hooks
Add `static:messaging.canMessageRoom` as well
This commit is contained in:
		@@ -264,7 +264,7 @@ Messaging.canMessageUser = function (uid, toUid, callback) {
 | 
			
		||||
				return next(new Error('[[error:chat-restricted]]'));
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			plugins.fireHook('filter:messaging.canMessageUser', {
 | 
			
		||||
			plugins.fireHook('static:messaging.canMessageUser', {
 | 
			
		||||
				uid: uid,
 | 
			
		||||
				toUid: toUid,
 | 
			
		||||
			}, function (err) {
 | 
			
		||||
@@ -306,7 +306,12 @@ Messaging.canMessageRoom = function (uid, roomId, callback) {
 | 
			
		||||
				return next(new Error('[[error:email-not-confirmed-chat]]'));
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			next();
 | 
			
		||||
			plugins.fireHook('static:messaging.canMessageRoom', {
 | 
			
		||||
				uid: uid,
 | 
			
		||||
				roomId: roomId,
 | 
			
		||||
			}, function (err) {
 | 
			
		||||
				next(err);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	], callback);
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user