mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Get the IDs of personns who sent comments.
This commit is contained in:
		@@ -6,6 +6,27 @@
 | 
			
		||||
 | 
			
		||||
ComunicWeb.components.comments.utils = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Get the IDs of the users who posted comments
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {Object} infos Informations about the comments
 | 
			
		||||
	 * @return {Object} List of users ID
 | 
			
		||||
	 */
 | 
			
		||||
	get_users_id: function(infos){
 | 
			
		||||
 | 
			
		||||
		//Process the list of users
 | 
			
		||||
		var users = [];
 | 
			
		||||
 | 
			
		||||
		var i;
 | 
			
		||||
		for(i in infos){
 | 
			
		||||
 | 
			
		||||
			//If the user isn't already present in the list, add it
 | 
			
		||||
			if(!users.includes(infos[i].userID))
 | 
			
		||||
				users.push(infos[i].userID);
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return users;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user