mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-03 19:14:03 +00:00 
			
		
		
		
	Can remove user from all its conversations
This commit is contained in:
		@@ -462,6 +462,9 @@ export class AccountHelper {
 | 
			
		||||
		
 | 
			
		||||
		// Delete conversation messages
 | 
			
		||||
		await ConversationsHelper.DeleteAllUserMessages(userID);
 | 
			
		||||
		
 | 
			
		||||
		// Remove the user from all its conversations
 | 
			
		||||
		await ConversationsHelper.DeleteAllUserConversations(userID);
 | 
			
		||||
		*/
 | 
			
		||||
		
 | 
			
		||||
		// TODO : continue work
 | 
			
		||||
 
 | 
			
		||||
@@ -390,6 +390,16 @@ export class ConversationsHelper {
 | 
			
		||||
			await this.DeleteMessage(msg);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Remove the user from all the conversations he belongs to
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID Target user ID
 | 
			
		||||
	 */
 | 
			
		||||
	public static async DeleteAllUserConversations(userID: number) {
 | 
			
		||||
		for(const conv of await this.GetListUser(userID))
 | 
			
		||||
			await this.RemoveUserFromConversation(userID, conv.id);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Mark the user has seen the last messages of the conversation
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user