diff options
author | Jonas Franz <info@jonasfranz.software> | 2017-05-25 04:38:56 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-25 10:38:56 +0800 |
commit | 03912ce0142039022481ccf3798ab937e9cf4f0b (patch) | |
tree | f002e8eb851500c034762deb6f5c2c99271c8ff2 /models/issue_mail.go | |
parent | cb74f1b84dff0099b3715329975621868c63c4a6 (diff) | |
download | gitea-03912ce0142039022481ccf3798ab937e9cf4f0b.tar.gz gitea-03912ce0142039022481ccf3798ab937e9cf4f0b.zip |
Adding #issuecomment to the URL in E-Mail notifications (#1674)
* Added comment's hashtag to url for mail notifications.
Signed-off-by: Jonas <info@jonasfranz.software>
* Added comment's hashtag to url for mail notifications.
Added explanation to return statement.
Signed-off-by: Jonas <info@jonasfranz.software>
* Added comment's hashtag to url for mail notifications.
Added explanation to return statement + documentation.
Signed-off-by: Jonas <info@jonasfranz.software>
* Added comment's hashtag to url for mail notifications.
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Replacing in-line link generation with HTMLURL. (+gofmt)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Replaced action-based model with nil-based model. (+gofmt)
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants.
Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Updating comment for mailIssueCommentToParticipants
Signed-off-by: Jonas Franz <info@jonasfranz.software>
Diffstat (limited to 'models/issue_mail.go')
-rw-r--r-- | models/issue_mail.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/issue_mail.go b/models/issue_mail.go index 4b6542ddb4..615aa82f06 100644 --- a/models/issue_mail.go +++ b/models/issue_mail.go @@ -22,7 +22,7 @@ func (issue *Issue) mailSubject() string { // This function sends two list of emails: // 1. Repository watchers and users who are participated in comments. // 2. Users who are not in 1. but get mentioned in current issue/comment. -func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) error { +func mailIssueCommentToParticipants(issue *Issue, doer *User, comment *Comment, mentions []string) error { if !setting.Service.EnableNotifyMail { return nil } @@ -70,7 +70,8 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) tos = append(tos, participants[i].Email) names = append(names, participants[i].Name) } - SendIssueCommentMail(issue, doer, tos) + + SendIssueCommentMail(issue, doer, comment, tos) // Mail mentioned people and exclude watchers. names = append(names, doer.Name) @@ -82,7 +83,7 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string) tos = append(tos, mentions[i]) } - SendIssueMentionMail(issue, doer, GetUserEmailsByNames(tos)) + SendIssueMentionMail(issue, doer, comment, GetUserEmailsByNames(tos)) return nil } @@ -95,7 +96,7 @@ func (issue *Issue) MailParticipants() (err error) { return fmt.Errorf("UpdateIssueMentions [%d]: %v", issue.ID, err) } - if err = mailIssueCommentToParticipants(issue, issue.Poster, mentions); err != nil { + if err = mailIssueCommentToParticipants(issue, issue.Poster, nil, mentions); err != nil { log.Error(4, "mailIssueCommentToParticipants: %v", err) } |