mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Can check following status of a friend
This commit is contained in:
		@@ -128,6 +128,24 @@ export class FriendsHelper {
 | 
			
		||||
		}) > 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Check whether a user is following a friend or not
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID The ID of the user supposed to following a friend
 | 
			
		||||
	 * @param friendID The target friend
 | 
			
		||||
	 */
 | 
			
		||||
	public static async IsFollowing(userID: number, friendID: number) : Promise<boolean> {
 | 
			
		||||
		return await DatabaseHelper.Count({
 | 
			
		||||
			table: FRIENDS_TABLE,
 | 
			
		||||
			where: {
 | 
			
		||||
				ID_personne: userID,
 | 
			
		||||
				ID_amis: friendID,
 | 
			
		||||
				actif: 1,
 | 
			
		||||
				abonnement: 1
 | 
			
		||||
			}
 | 
			
		||||
		}) > 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Check out whether friendship allows to create posts or not
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user