Skip to content

Commit

Permalink
Fix the variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Nov 17, 2023
1 parent e262203 commit b4794b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/webhook/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ func (m *MatrixPayload) Repository(p *api.RepositoryPayload) (api.Payloader, err

func (m *MatrixPayload) Package(p *api.PackagePayload) (api.Payloader, error) {
senderLink := MatrixLinkFormatter(setting.AppURL+p.Sender.UserName, p.Sender.UserName)
repoLink := MatrixLinkFormatter(p.Package.HTMLURL, p.Package.Name)
packageLink := MatrixLinkFormatter(p.Package.HTMLURL, p.Package.Name)
var text string

switch p.Action {
case api.HookPackageCreated:
text = fmt.Sprintf("[%s] Package published by %s", repoLink, senderLink)
text = fmt.Sprintf("[%s] Package published by %s", packageLink, senderLink)
case api.HookPackageDeleted:
text = fmt.Sprintf("[%s] Package deleted by %s", repoLink, senderLink)
text = fmt.Sprintf("[%s] Package deleted by %s", packageLink, senderLink)
}

return getMatrixPayload(text, nil, m.MsgType), nil
Expand Down

0 comments on commit b4794b3

Please sign in to comment.