Update last replies on topics properly for delete all posts.

This commit is contained in:
Azareal 2020-01-14 20:38:05 +10:00
parent e4cfe610f6
commit 2625db3989
1 changed files with 11 additions and 0 deletions

View File

@ -411,10 +411,21 @@ func (u *User) DeletePosts() error {
}
// TODO: Move this bit to *Topic
_, err = replyStmts.removeRepliesFromTopic.Exec(1, tid)
if err != nil {
return err
}
_, err = replyStmts.updateTopicReplies.Exec(tid)
if err != nil {
return err
}
_, err = replyStmts.updateTopicReplies2.Exec(tid)
if tc != nil {
tc.Remove(tid)
}
_ = rc.Remove(rid)
if err != nil {
return err
}
// TODO: Remove alerts.
}
return rows.Err()