1
0
mirror of https://github.com/pinpox/gitea-matrix-bot synced 2024-11-22 10:21:58 +01:00

added blank files for tests

This commit is contained in:
Pablo Ovelleiro Corral 2019-04-23 22:25:46 +02:00
parent 8c50a35e37
commit cde6cc0266
No known key found for this signature in database
GPG Key ID: F7C1D57C8464E825
69 changed files with 3 additions and 3 deletions

@ -55,14 +55,14 @@ func PostHandler(w http.ResponseWriter, r *http.Request) {
messageText, err := generateTextMessage(postData, r.Header.Get("X-Gitea-Event"))
if err != nil {
log.Warning(err)
log.Warning(postData)
log.Warningf("%s", body)
}
switch msgType {
case "html":
messageHTML, err := generateHTMLMessage(postData, r.Header.Get("X-Gitea-Event"))
if err != nil {
log.Warning(err)
log.Warning(postData)
log.Warningf("%s", body)
}
mygiteabot.SendHTMLToRoom(room, messageHTML, messageText)
case "plain":
@ -177,7 +177,7 @@ func generateTextMessage(data GiteaPostData, eventHeader string) (string, error)
var tpl bytes.Buffer
mesgTemplates := map[string]string{
"push": "[{{.Repository.Fullname}}] {{.Pusher.FullName}} pushed " + strconv.Itoa(len(data.Commits)) + " commit(s) to {{.Repository.Name}}",
"push": "[{{.Repository.Fullname}}]: {{.Pusher.FullName}} pushed " + strconv.Itoa(len(data.Commits)) + " commit(s) to {{.Repository.Name}}",
"issues.assigned": "[{{.Repository.FullName}}]: {{.Sender.FullName}} assigned issue #{{.Issue.Number}} {{.Issue.Title}} to {{}}",
"issues.closed": "[{{.Repository.FullName}}]: {{.Sender.FullName}} closed issue #{{.Issue.Number}} {{.Issue.Title}}",
"issues.demilestoned": "[{{.Repository.FullName}}]: {{.Sender.FullName}} removed milestone TODO from issue #{{.Issue.Number}} {{.Issue.Title}}",

0
testdata/gitea_postdata/html/fork vendored Normal file

0
testdata/gitea_postdata/html/push vendored Normal file

0
testdata/gitea_postdata/text/fork vendored Normal file

0
testdata/gitea_postdata/text/push vendored Normal file