summaryrefslogtreecommitdiffstats
path: root/models/review.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-06 21:39:29 +0800
committerLauris BH <lauris@nix.lv>2019-11-06 15:39:29 +0200
commit12170d26a7fc75beef46311996db3798d7ad7c1c (patch)
tree92ee2787541ef99680fd9825dda04552930de4df /models/review.go
parent72aa5a20ecf8aa3f7c110fd51c37994d950e0ba8 (diff)
downloadgitea-12170d26a7fc75beef46311996db3798d7ad7c1c.tar.gz
gitea-12170d26a7fc75beef46311996db3798d7ad7c1c.zip
Split sendCreateCommentAction as two parts, one for update comment related informations, another for actions (#8784)
* Split sendCreateCommentAction as two parts, one for update comment related informations, another for actions * fix lint
Diffstat (limited to 'models/review.go')
-rw-r--r--models/review.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/review.go b/models/review.go
index 58660b2e3d..89a26d6fdb 100644
--- a/models/review.go
+++ b/models/review.go
@@ -129,13 +129,17 @@ func (r *Review) publish(e *xorm.Engine) error {
go func(en *xorm.Engine, review *Review, comm *Comment) {
sess := en.NewSession()
defer sess.Close()
- if err := sendCreateCommentAction(sess, &CreateCommentOptions{
+ opts := &CreateCommentOptions{
Doer: comm.Poster,
Issue: review.Issue,
Repo: review.Issue.Repo,
Type: comm.Type,
Content: comm.Content,
- }, comm); err != nil {
+ }
+ if err := updateCommentInfos(sess, opts, comm); err != nil {
+ log.Warn("updateCommentInfos: %v", err)
+ }
+ if err := sendCreateCommentAction(sess, opts, comm); err != nil {
log.Warn("sendCreateCommentAction: %v", err)
}
}(e, r, comment)