diff options
author | Unknwon <u@gogs.io> | 2015-12-06 23:07:02 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-06 23:07:02 -0500 |
commit | dce2a9e7e1146293f711c0dbd9725ac7eb0b8a16 (patch) | |
tree | 899d61edc698d04ed9aaa036dbfb1ae6402ceba6 /models | |
parent | abb02889f21b021b826e62999947c895e4d9c3a4 (diff) | |
download | gitea-dce2a9e7e1146293f711c0dbd9725ac7eb0b8a16.tar.gz gitea-dce2a9e7e1146293f711c0dbd9725ac7eb0b8a16.zip |
fix wrong slack webhook payload URL
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 2 | ||||
-rw-r--r-- | models/repo.go | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/models/action.go b/models/action.go index c54b180bc2..bb5860a666 100644 --- a/models/action.go +++ b/models/action.go @@ -479,7 +479,7 @@ func CommitRepoAction( commits[i] = &api.PayloadCommit{ ID: cmt.Sha1, Message: cmt.Message, - URL: fmt.Sprintf("%s/commit/%s", repo.RepoLink(), cmt.Sha1), + URL: fmt.Sprintf("%s/commit/%s", repo.FullRepoLink(), cmt.Sha1), Author: &api.PayloadAuthor{ Name: cmt.AuthorName, Email: cmt.AuthorEmail, diff --git a/models/repo.go b/models/repo.go index 5b66d2c0be..25f66600ab 100644 --- a/models/repo.go +++ b/models/repo.go @@ -305,6 +305,10 @@ func (repo *Repository) RepoLink() string { return setting.AppSubUrl + "/" + repo.MustOwner().Name + "/" + repo.Name } +func (repo *Repository) FullRepoLink() string { + return setting.AppUrl + repo.MustOwner().Name + "/" + repo.Name +} + func (repo *Repository) HasAccess(u *User) bool { has, _ := HasAccess(u, repo, ACCESS_MODE_READ) return has @@ -387,7 +391,7 @@ func (repo *Repository) ComposePayload() *api.PayloadRepo { return &api.PayloadRepo{ ID: repo.ID, Name: repo.LowerName, - URL: repo.RepoLink(), + URL: repo.FullRepoLink(), SSHURL: cl.SSH, CloneURL: cl.HTTPS, Description: repo.Description, |