mirror of
https://github.com/gotify/server.git
synced 2026-05-06 21:42:07 +08:00
Correctly delete all messages from a user
Till now only the ApplicationID got remove from the message, therefore the message was still in the database but not visible for the user.
This commit is contained in:
committed by
Jannis Mattheis
parent
317bb1cb3e
commit
8d7c7a5a50
@@ -47,7 +47,7 @@ func (d *GormDatabase) DeleteMessagesByApplication(applicationID uint) error {
|
||||
// DeleteMessagesByUser deletes all messages from a user.
|
||||
func (d *GormDatabase) DeleteMessagesByUser(userID uint) error {
|
||||
for _, app := range d.GetApplicationsByUser(userID) {
|
||||
d.DB.Model(app).Association("Messages").Clear()
|
||||
d.DeleteMessagesByApplication(app.ID)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user