mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Can remove user from all its conversations
This commit is contained in:
parent
01245a1778
commit
50a16c0f8c
@ -462,8 +462,11 @@ 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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user