From 828a27feeb11474b848be183a8fce2d036dec3cc Mon Sep 17 00:00:00 2001 From: S7evinK Date: Sat, 28 Mar 2020 14:09:55 +0100 Subject: Add Matrix webhook (#10831) * Add Matrix webhook Signed-off-by: Till Faelligen * Add template and related translations for Matrix hook Signed-off-by: Till Faelligen * Add actual webhook routes and form Signed-off-by: Till Faelligen * Add missing file Signed-off-by: Till Faelligen * Update modules/webhook/matrix_test.go * Use stricter regex to replace URLs Signed-off-by: Till Faelligen * Escape url and text Signed-off-by: Till Faelligen * Remove unnecessary whitespace * Fix copy and paste mistake Co-Authored-By: Tulir Asokan * Fix indention inconsistency * Use Authorization header instead of url parameter * Add raw commit information to webhook Co-authored-by: Lauris BH Co-authored-by: Tulir Asokan --- models/webhook.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models') diff --git a/models/webhook.go b/models/webhook.go index d161ca1ae9..5f3a285691 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -559,6 +559,7 @@ const ( TELEGRAM MSTEAMS FEISHU + MATRIX ) var hookTaskTypes = map[string]HookTaskType{ @@ -570,6 +571,7 @@ var hookTaskTypes = map[string]HookTaskType{ "telegram": TELEGRAM, "msteams": MSTEAMS, "feishu": FEISHU, + "matrix": MATRIX, } // ToHookTaskType returns HookTaskType by given name. @@ -596,6 +598,8 @@ func (t HookTaskType) Name() string { return "msteams" case FEISHU: return "feishu" + case MATRIX: + return "matrix" } return "" } -- cgit v1.2.3