aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2017-01-28 13:59:58 -0200
committerAndrey Nering <andrey.nering@gmail.com>2017-01-28 13:59:58 -0200
commit27d30f1a619ff716e39d79e7322c487e1299b75d (patch)
tree1f25ff3cdf4ca99350743a19d4f85797b4e4f8a3
parentbb5a6b7a07125b29604f479f45e59073cb3d4648 (diff)
downloadgitea-27d30f1a619ff716e39d79e7322c487e1299b75d.tar.gz
gitea-27d30f1a619ff716e39d79e7322c487e1299b75d.zip
Notifying on open PR, and Close/Reopen/Merge issue or PR
-rw-r--r--routers/repo/issue.go2
-rw-r--r--routers/repo/pull.go6
2 files changed, 8 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 6ef34746ed..7ae6140388 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -875,6 +875,8 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
log.Error(4, "ChangeStatus: %v", err)
} else {
log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed)
+
+ notification.Service.NotifyIssue(issue, ctx.User.ID)
}
}
}
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index f0162cca01..f518c9edca 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -16,7 +16,9 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
+ "code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
+
"github.com/Unknwon/com"
)
@@ -415,6 +417,8 @@ func MergePullRequest(ctx *context.Context) {
return
}
+ notification.Service.NotifyIssue(pr.Issue, ctx.User.ID)
+
log.Trace("Pull request merged: %d", pr.ID)
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index))
}
@@ -707,6 +711,8 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
return
}
+ notification.Service.NotifyIssue(pullIssue, ctx.User.ID)
+
log.Trace("Pull request created: %d/%d", repo.ID, pullIssue.ID)
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pullIssue.Index))
}