1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-02 08:57:32 -04:00

Fix Slack webhook fork message (#7774) (#7783)

The order of forkee and fork was mixed up.
This commit is contained in:
WGH 2019-08-07 18:57:08 +03:00 committed by techknowlogick
parent 7b92f91e88
commit 4f39e56795

View File

@ -120,8 +120,8 @@ func getSlackDeletePayload(p *api.DeletePayload, slack *SlackMeta) (*SlackPayloa
// getSlackForkPayload composes Slack payload for forked by a repository. // getSlackForkPayload composes Slack payload for forked by a repository.
func getSlackForkPayload(p *api.ForkPayload, slack *SlackMeta) (*SlackPayload, error) { func getSlackForkPayload(p *api.ForkPayload, slack *SlackMeta) (*SlackPayload, error) {
baseLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.Name) baseLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName)
forkLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName) forkLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.FullName)
text := fmt.Sprintf("%s is forked to %s", baseLink, forkLink) text := fmt.Sprintf("%s is forked to %s", baseLink, forkLink)
return &SlackPayload{ return &SlackPayload{
Channel: slack.Channel, Channel: slack.Channel,