Fix context usages (#35348)

This commit is contained in:
wxiaoguang
2025-08-27 19:00:01 +08:00
committed by GitHub
parent da5ce5c8e7
commit e837c998b7
48 changed files with 98 additions and 100 deletions
+4 -4
View File
@@ -56,9 +56,9 @@ func composeIssueCommentMessages(ctx context.Context, comment *mailComment, lang
commentType := issues_model.CommentTypeComment
if comment.Comment != nil {
commentType = comment.Comment.Type
link = comment.Issue.HTMLURL() + "#" + comment.Comment.HashTag()
link = comment.Issue.HTMLURL(ctx) + "#" + comment.Comment.HashTag()
} else {
link = comment.Issue.HTMLURL()
link = comment.Issue.HTMLURL(ctx)
}
reviewType := issues_model.ReviewTypeComment
@@ -175,7 +175,7 @@ func composeIssueCommentMessages(ctx context.Context, comment *mailComment, lang
msg.SetHeader("In-Reply-To", reference)
references := []string{reference}
listUnsubscribe := []string{"<" + comment.Issue.HTMLURL() + ">"}
listUnsubscribe := []string{"<" + comment.Issue.HTMLURL(ctx) + ">"}
if setting.IncomingEmail.Enabled {
if replyPayload != nil {
@@ -313,7 +313,7 @@ func generateAdditionalHeadersForIssue(ctx *mailComment, reason string, recipien
maps.Copy(headers, generateReasonHeaders(reason))
headers["X-Gitea-Issue-ID"] = issueID
headers["X-Gitea-Issue-Link"] = ctx.Issue.HTMLURL()
headers["X-Gitea-Issue-Link"] = ctx.Issue.HTMLURL(context.TODO()) // FIXME: use proper context
headers["X-GitLab-Issue-IID"] = issueID
return headers