mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Delete all conversation messages of the user
This commit is contained in:
parent
50e2277a30
commit
01245a1778
@ -459,8 +459,11 @@ 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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user