summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-12-22 03:29:26 -0500
committerzeripath <art27@cantab.net>2019-12-22 08:29:26 +0000
commit1df701fd1abbcee93dfcd3cdb114a0f35cb6be45 (patch)
tree70b1f1a47be30eb83ae89a6ba444bcf48357f303 /services
parent875d6b2f8e52a362e47118393bcd47026852db8c (diff)
downloadgitea-1df701fd1abbcee93dfcd3cdb114a0f35cb6be45.tar.gz
gitea-1df701fd1abbcee93dfcd3cdb114a0f35cb6be45.zip
Add ActionCommentPull action (#9456)
* Add ActionCommentPull action Adds ActionCommentPull action to distinguish between a comment on an issue and on a pull request * Update modules/notification/action/action.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services')
-rw-r--r--services/mailer/mail.go2
-rw-r--r--services/mailer/mail_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/mailer/mail.go b/services/mailer/mail.go
index 7d26487a07..a8768de6cd 100644
--- a/services/mailer/mail.go
+++ b/services/mailer/mail.go
@@ -291,7 +291,7 @@ func actionToTemplate(issue *models.Issue, actionType models.ActionType,
switch actionType {
case models.ActionCreateIssue, models.ActionCreatePullRequest:
name = "new"
- case models.ActionCommentIssue:
+ case models.ActionCommentIssue, models.ActionCommentPull:
name = "comment"
case models.ActionCloseIssue, models.ActionClosePullRequest:
name = "close"
diff --git a/services/mailer/mail_test.go b/services/mailer/mail_test.go
index fd87a157b2..43e99c635e 100644
--- a/services/mailer/mail_test.go
+++ b/services/mailer/mail_test.go
@@ -153,7 +153,7 @@ func TestTemplateSelection(t *testing.T) {
pull := models.AssertExistsAndLoadBean(t, &models.Issue{ID: 2, Repo: repo, Poster: doer}).(*models.Issue)
comment = models.AssertExistsAndLoadBean(t, &models.Comment{ID: 4, Issue: pull}).(*models.Comment)
- msg = testComposeIssueCommentMessage(t, &mailCommentContext{Issue: pull, Doer: doer, ActionType: models.ActionCommentIssue,
+ msg = testComposeIssueCommentMessage(t, &mailCommentContext{Issue: pull, Doer: doer, ActionType: models.ActionCommentPull,
Content: "test body", Comment: comment}, tos, false, "TestTemplateSelection")
expect(t, msg, "pull/comment/subject", "pull/comment/body")