GODT-1499: Remove message from DB once is not on server any more

This commit is contained in:
Jakub
2022-01-18 18:23:00 +01:00
committed by Jakub Cuth
parent a3d2df9d38
commit 8e0693ab03
9 changed files with 107 additions and 5 deletions

View File

@ -104,3 +104,14 @@ func (ctl *Controller) GetMessages(username, labelID string) ([]*pmapi.Message,
return messages, nil
}
func (ctl *Controller) RemoveUserMessageWithoutEvent(username string, messageID string) error {
client, err := getPersistentClient(username)
if err != nil {
return err
}
addMessageIDToSkipEventOnceDeleted(messageID)
return client.DeleteMessages(context.Background(), []string{messageID})
}