|
|
@ -538,6 +538,10 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen |
|
|
|
switch opts.Type { |
|
|
|
switch opts.Type { |
|
|
|
case CommentTypeCode: |
|
|
|
case CommentTypeCode: |
|
|
|
if comment.ReviewID != 0 { |
|
|
|
if comment.ReviewID != 0 { |
|
|
|
|
|
|
|
// Hotfix for 1.10.0 as the Review object has not yet been committed in the other session
|
|
|
|
|
|
|
|
if opts.Review != nil { |
|
|
|
|
|
|
|
comment.Review = opts.Review |
|
|
|
|
|
|
|
} |
|
|
|
if comment.Review == nil { |
|
|
|
if comment.Review == nil { |
|
|
|
if err := comment.loadReview(e); err != nil { |
|
|
|
if err := comment.loadReview(e); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
@ -596,6 +600,12 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen |
|
|
|
if err = opts.Issue.updateClosedNum(e); err != nil { |
|
|
|
if err = opts.Issue.updateClosedNum(e); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
case CommentTypeReview: |
|
|
|
|
|
|
|
// Hotfix for 1.10.0; make sure a dashboard entry is created
|
|
|
|
|
|
|
|
if opts.Content == "" { |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
act.OpType = ActionCommentIssue |
|
|
|
} |
|
|
|
} |
|
|
|
// update the issue's updated_unix column
|
|
|
|
// update the issue's updated_unix column
|
|
|
|
if err = updateIssueCols(e, opts.Issue, "updated_unix"); err != nil { |
|
|
|
if err = updateIssueCols(e, opts.Issue, "updated_unix"); err != nil { |
|
|
@ -751,11 +761,12 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep |
|
|
|
|
|
|
|
|
|
|
|
// CreateCommentOptions defines options for creating comment
|
|
|
|
// CreateCommentOptions defines options for creating comment
|
|
|
|
type CreateCommentOptions struct { |
|
|
|
type CreateCommentOptions struct { |
|
|
|
Type CommentType |
|
|
|
Type CommentType |
|
|
|
Doer *User |
|
|
|
Doer *User |
|
|
|
Repo *Repository |
|
|
|
Repo *Repository |
|
|
|
Issue *Issue |
|
|
|
Issue *Issue |
|
|
|
Label *Label |
|
|
|
Label *Label |
|
|
|
|
|
|
|
Review *Review |
|
|
|
|
|
|
|
|
|
|
|
DependentIssueID int64 |
|
|
|
DependentIssueID int64 |
|
|
|
OldMilestoneID int64 |
|
|
|
OldMilestoneID int64 |
|
|
|