From 2625db39891a2254ffe2c75c936582c0c7314ddf Mon Sep 17 00:00:00 2001 From: Azareal Date: Tue, 14 Jan 2020 20:38:05 +1000 Subject: [PATCH] Update last replies on topics properly for delete all posts. --- common/user.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/user.go b/common/user.go index d41ea705..41ea9961 100644 --- a/common/user.go +++ b/common/user.go @@ -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()