summaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
authorJonas Franz <info@jonasfranz.software>2017-05-25 04:38:56 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-05-25 10:38:56 +0800
commit03912ce0142039022481ccf3798ab937e9cf4f0b (patch)
treef002e8eb851500c034762deb6f5c2c99271c8ff2 /models/issue_comment.go
parentcb74f1b84dff0099b3715329975621868c63c4a6 (diff)
downloadgitea-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_comment.go')
-rw-r--r--models/issue_comment.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index e133cc049b..a65abfe012 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -153,7 +153,7 @@ func (c *Comment) HTMLURL() string {
log.Error(4, "GetIssueByID(%d): %v", c.IssueID, err)
return ""
}
- return fmt.Sprintf("%s#issuecomment-%d", issue.HTMLURL(), c.ID)
+ return fmt.Sprintf("%s#%s", issue.HTMLURL(), c.HashTag())
}
// IssueURL formats a URL-string to the issue
@@ -289,7 +289,7 @@ func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (e
case ActionReopenIssue:
issue.Content = fmt.Sprintf("Reopened #%d", issue.Index)
}
- if err = mailIssueCommentToParticipants(issue, c.Poster, mentions); err != nil {
+ if err = mailIssueCommentToParticipants(issue, c.Poster, c, mentions); err != nil {
log.Error(4, "mailIssueCommentToParticipants: %v", err)
}