mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	Notification delivery (#6072)
* ability for users to choose how they receive notifications add type field to more notifications, the type field is used to determine what to do based on user setting(none,notification,email,notificationemail) * change var name to types * cleanup * add event types for privileged users * remove unused language keys * fix uids check * changed if statements * upgrade script to preserver old settings
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							e68e5122e2
						
					
				
				
					commit
					dd176dd5f2
				
			
							
								
								
									
										16
									
								
								src/user.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/user.js
									
									
									
									
									
								
							@@ -208,13 +208,17 @@ User.isGlobalModerator = function (uid, callback) {
 | 
			
		||||
	privileges.users.isGlobalModerator(uid, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
User.getPrivileges = function (uid, callback) {
 | 
			
		||||
	async.parallel({
 | 
			
		||||
		isAdmin: async.apply(User.isAdministrator, uid),
 | 
			
		||||
		isGlobalModerator: async.apply(User.isGlobalModerator, uid),
 | 
			
		||||
		isModeratorOfAnyCategory: async.apply(User.isModeratorOfAnyCategory, uid),
 | 
			
		||||
	}, callback);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
User.isPrivileged = function (uid, callback) {
 | 
			
		||||
	async.parallel([
 | 
			
		||||
		async.apply(User.isAdministrator, uid),
 | 
			
		||||
		async.apply(User.isGlobalModerator, uid),
 | 
			
		||||
		async.apply(User.isModeratorOfAnyCategory, uid),
 | 
			
		||||
	], function (err, results) {
 | 
			
		||||
		callback(err, results ? results.some(Boolean) : false);
 | 
			
		||||
	User.getPrivileges(uid, function (err, results) {
 | 
			
		||||
		callback(err, results ? (results.isAdmin || results.isGlobalModerator || results.isModeratorOfAnyCategory) : false);
 | 
			
		||||
	});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user