mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Can check whether a user is the moderator of a conversation or not
This commit is contained in:
		@@ -166,6 +166,22 @@ export class ConversationsHelper {
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Check out whether a user is the moderator of a conversation or not
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID User to check
 | 
			
		||||
	 * @param convID Target conversation
 | 
			
		||||
	 */
 | 
			
		||||
	public static async IsUserModerator(userID : number, convID : number) : Promise<boolean> {
 | 
			
		||||
		return await DatabaseHelper.Count({
 | 
			
		||||
			table: USERS_TABLE,
 | 
			
		||||
			where: {
 | 
			
		||||
				id: convID,
 | 
			
		||||
				user_id: userID
 | 
			
		||||
			}
 | 
			
		||||
		}) == 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Get the list of members of a conversation
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user