diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-10-18 19:23:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 19:23:05 +0800 |
commit | ea619b39b2f2a3c1fb5ad28ebd4a269b2f822111 (patch) | |
tree | ef101ad2b39dc5be1744e4488bcdd5beab16e45d /routers/repo/pull_review.go | |
parent | dd62ca7ba9b49e799a8bea896cff1b209f813b7e (diff) | |
download | gitea-ea619b39b2f2a3c1fb5ad28ebd4a269b2f822111.tar.gz gitea-ea619b39b2f2a3c1fb5ad28ebd4a269b2f822111.zip |
Add notification interface and refactor UI notifications (#5085)
* add notification interface and refactor UI notifications
* add missing methods on notification interface and notifiy only issue status really changed
* implement NotifyPullRequestReview for ui notification
Diffstat (limited to 'routers/repo/pull_review.go')
-rw-r--r-- | routers/repo/pull_review.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/routers/repo/pull_review.go b/routers/repo/pull_review.go index 9d1db3ff4e..91257fea33 100644 --- a/routers/repo/pull_review.go +++ b/routers/repo/pull_review.go @@ -79,7 +79,7 @@ func CreateCodeComment(ctx *context.Context, form auth.CodeCommentForm) { } // Send no notification if comment is pending if !form.IsReview { - notification.Service.NotifyIssue(issue, ctx.User.ID) + notification.NotifyCreateIssueComment(ctx.User, issue.Repo, issue, comment) } log.Trace("Comment created: %d/%d/%d", ctx.Repo.Repository.ID, issue.ID, comment.ID) @@ -184,5 +184,13 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) { ctx.ServerError("Publish", err) return } + + pr, err := issue.GetPullRequest() + if err != nil { + ctx.ServerError("GetPullRequest", err) + return + } + notification.NotifyPullRequestReview(pr, review, comm) + ctx.Redirect(fmt.Sprintf("%s/pulls/%d#%s", ctx.Repo.RepoLink, issue.Index, comm.HashTag())) } |