summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorDaniel Grier <daniel.grier@gmail.com>2019-04-20 00:18:06 +1000
committertechknowlogick <matti@mdranta.net>2019-04-19 10:18:06 -0400
commitb9d1fb6de32613ada3869d2a9692cb078ed48534 (patch)
treee02d62ed2bbe2c92cad02ef405316507dc8d120b /modules
parent2af67f6044af1cad7136ce8c123e37ab090ca9bc (diff)
downloadgitea-b9d1fb6de32613ada3869d2a9692cb078ed48534.tar.gz
gitea-b9d1fb6de32613ada3869d2a9692cb078ed48534.zip
Add support for MS Teams webhooks (#6632)
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/repo_form.go11
-rw-r--r--modules/setting/webhook.go2
2 files changed, 12 insertions, 1 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go
index d37a5b94d8..fd6891288d 100644
--- a/modules/auth/repo_form.go
+++ b/modules/auth/repo_form.go
@@ -275,6 +275,17 @@ func (f *NewTelegramHookForm) Validate(ctx *macaron.Context, errs binding.Errors
return validate(errs, ctx.Data, f, ctx.Locale)
}
+// NewMSTeamsHookForm form for creating MS Teams hook
+type NewMSTeamsHookForm struct {
+ PayloadURL string `binding:"Required;ValidUrl"`
+ WebhookForm
+}
+
+// Validate validates the fields
+func (f *NewMSTeamsHookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+ return validate(errs, ctx.Data, f, ctx.Locale)
+}
+
// .___
// | | ______ ________ __ ____
// | |/ ___// ___/ | \_/ __ \
diff --git a/modules/setting/webhook.go b/modules/setting/webhook.go
index 0d91e7d9e7..b0e7d66ad2 100644
--- a/modules/setting/webhook.go
+++ b/modules/setting/webhook.go
@@ -25,6 +25,6 @@ func newWebhookService() {
Webhook.QueueLength = sec.Key("QUEUE_LENGTH").MustInt(1000)
Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5)
Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool()
- Webhook.Types = []string{"gitea", "gogs", "slack", "discord", "dingtalk", "telegram"}
+ Webhook.Types = []string{"gitea", "gogs", "slack", "discord", "dingtalk", "telegram", "msteams"}
Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10)
}