aboutsummaryrefslogtreecommitdiffstats
path: root/services/webhook/matrix.go
diff options
context:
space:
mode:
authorAkshay Mankar <itsakshaymankar@gmail.com>2022-10-07 23:06:34 +0200
committerGitHub <noreply@github.com>2022-10-07 22:06:34 +0100
commitf0aed8205b28d984698414d32635b66927ea6ca0 (patch)
tree92811e09be4534349e634b5a57b41ad842629388 /services/webhook/matrix.go
parent223556073c51b34f2ccca7c1036552a4807d1f42 (diff)
downloadgitea-f0aed8205b28d984698414d32635b66927ea6ca0.tar.gz
gitea-f0aed8205b28d984698414d32635b66927ea6ca0.zip
Fix formatted link for PR review notifications to matrix (#21319)
The PR review notifications HTML was written as markdown due to not using `MatrixLinkFormatter`.
Diffstat (limited to 'services/webhook/matrix.go')
-rw-r--r--services/webhook/matrix.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/webhook/matrix.go b/services/webhook/matrix.go
index f4c4cf0e9a..59eae48307 100644
--- a/services/webhook/matrix.go
+++ b/services/webhook/matrix.go
@@ -195,7 +195,7 @@ func (m *MatrixPayloadUnsafe) PullRequest(p *api.PullRequestPayload) (api.Payloa
func (m *MatrixPayloadUnsafe) Review(p *api.PullRequestPayload, event webhook_model.HookEventType) (api.Payloader, error) {
senderLink := MatrixLinkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName)
title := fmt.Sprintf("#%d %s", p.Index, p.PullRequest.Title)
- titleLink := fmt.Sprintf("%s/pulls/%d", p.Repository.HTMLURL, p.Index)
+ titleLink := MatrixLinkFormatter(p.PullRequest.URL, title)
repoLink := MatrixLinkFormatter(p.Repository.HTMLURL, p.Repository.FullName)
var text string
@@ -206,7 +206,7 @@ func (m *MatrixPayloadUnsafe) Review(p *api.PullRequestPayload, event webhook_mo
return nil, err
}
- text = fmt.Sprintf("[%s] Pull request review %s: [%s](%s) by %s", repoLink, action, title, titleLink, senderLink)
+ text = fmt.Sprintf("[%s] Pull request review %s: %s by %s", repoLink, action, titleLink, senderLink)
}
return getMatrixPayloadUnsafe(text, nil, m.AccessToken, m.MsgType), nil