fix wrong slack webhook payload URL

This commit is contained in:
Unknwon 2015-12-06 23:07:02 -05:00
parent abb02889f2
commit dce2a9e7e1
7 changed files with 16 additions and 7 deletions

View file

@ -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,

View file

@ -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,