mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add Matrix webhook (#10831)
* Add Matrix webhook Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Add template and related translations for Matrix hook Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Add actual webhook routes and form Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Add missing file Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Update modules/webhook/matrix_test.go * Use stricter regex to replace URLs Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Escape url and text Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Remove unnecessary whitespace * Fix copy and paste mistake Co-Authored-By: Tulir Asokan <tulir@maunium.net> * Fix indention inconsistency * Use Authorization header instead of url parameter * Add raw commit information to webhook Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
		@@ -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 ""
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user