diff options
Diffstat (limited to 'services/webhook/matrix.go')
-rw-r--r-- | services/webhook/matrix.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/services/webhook/matrix.go b/services/webhook/matrix.go index e649a07609..5e9f808d8b 100644 --- a/services/webhook/matrix.go +++ b/services/webhook/matrix.go @@ -29,10 +29,10 @@ func newMatrixRequest(_ context.Context, w *webhook_model.Webhook, t *webhook_mo if err := json.Unmarshal([]byte(w.Meta), meta); err != nil { return nil, nil, fmt.Errorf("GetMatrixPayload meta json: %w", err) } - mc := matrixConvertor{ + var pc payloadConvertor[MatrixPayload] = matrixConvertor{ MsgType: messageTypeText[meta.MessageType], } - payload, err := newPayload(mc, []byte(t.PayloadContent), t.EventType) + payload, err := newPayload(pc, []byte(t.PayloadContent), t.EventType) if err != nil { return nil, nil, err } @@ -87,8 +87,6 @@ type MatrixPayload struct { Commits []*api.PayloadCommit `json:"io.gitea.commits,omitempty"` } -var _ payloadConvertor[MatrixPayload] = matrixConvertor{} - type matrixConvertor struct { MsgType string } |