mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Delete all conversation messages of the user
This commit is contained in:
		@@ -459,6 +459,9 @@ export class AccountHelper {
 | 
			
		||||
		
 | 
			
		||||
		// Delete all user movies
 | 
			
		||||
		await MoviesHelper.DeleteAllUser(userID);
 | 
			
		||||
		
 | 
			
		||||
		// Delete conversation messages
 | 
			
		||||
		await ConversationsHelper.DeleteAllUserMessages(userID);
 | 
			
		||||
		*/
 | 
			
		||||
 | 
			
		||||
		// TODO : continue work
 | 
			
		||||
 
 | 
			
		||||
@@ -380,6 +380,16 @@ export class ConversationsHelper {
 | 
			
		||||
		})).map(m => this.DBToConversationMessage(m.conv_id, m));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Delete all the messages of a given user
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param userID Target user ID
 | 
			
		||||
	 */
 | 
			
		||||
	public static async DeleteAllUserMessages(userID: number) {
 | 
			
		||||
		for(const msg of await this.ExportAllMessages(userID))
 | 
			
		||||
			await this.DeleteMessage(msg);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Mark the user has seen the last messages of the conversation
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user