Merge pull request 'mailer: Put the username in X-Forgejo-Sender and -Recipient' (#3932) from algernon/forgejo:of-display-and-user-names into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3932
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-05-28 17:50:01 +00:00
commit f770ae3eb6
2 changed files with 4 additions and 2 deletions

View file

@ -415,8 +415,8 @@ func generateAdditionalHeaders(ctx *mailCommentContext, reason string, recipient
"X-Gitea-Issue-Link": ctx.Issue.HTMLURL(),
"X-Forgejo-Reason": reason,
"X-Forgejo-Sender": ctx.Doer.DisplayName(),
"X-Forgejo-Recipient": recipient.DisplayName(),
"X-Forgejo-Sender": ctx.Doer.Name,
"X-Forgejo-Recipient": recipient.Name,
"X-Forgejo-Recipient-Address": recipient.Email,
"X-Forgejo-Repository": repo.Name,
"X-Forgejo-Repository-Path": repo.FullName(),

View file

@ -369,6 +369,8 @@ func TestGenerateAdditionalHeaders(t *testing.T) {
"X-Gitea-Repository-Link": "https://try.gitea.io/user2/repo1",
"X-Gitea-Issue-ID": "1",
"X-Gitea-Issue-Link": "https://try.gitea.io/user2/repo1/issues/1",
"X-Forgejo-Sender": "user2",
"X-Forgejo-Recipient": "test",
}
for key, value := range expected {