[REFACTOR] add Icon to webhook.Interface

This commit is contained in:
oliverpool 2024-03-22 16:02:48 +01:00
parent bc04183e47
commit 120fa61a0a
15 changed files with 54 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import (
"crypto/sha1"
"encoding/hex"
"fmt"
"html/template"
"net/http"
"net/url"
"regexp"
@ -20,6 +21,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/svg"
"code.gitea.io/gitea/modules/util"
webhook_module "code.gitea.io/gitea/modules/webhook"
"code.gitea.io/gitea/services/forms"
@ -29,6 +31,10 @@ type matrixHandler struct{}
func (matrixHandler) Type() webhook_module.HookType { return webhook_module.MATRIX }
func (matrixHandler) Icon(size int) template.HTML {
return svg.RenderHTML("gitea-matrix", size, "img")
}
func (matrixHandler) FormFields(bind func(any)) FormFields {
var form struct {
forms.WebhookForm