diff options
author | Christopher Brickley <brickley@gmail.com> | 2014-08-24 08:59:47 -0400 |
---|---|---|
committer | Christopher Brickley <brickley@gmail.com> | 2014-08-31 12:01:59 -0400 |
commit | 2bce24068dc3c64ee5e501c48b7f080c48383970 (patch) | |
tree | 1ec707518cb37307cd05fa5cf6ef6bbf670caf9b /modules | |
parent | 5e6091a30ae4befd68041aaff3f70d7334ce1b1c (diff) | |
download | gitea-2bce24068dc3c64ee5e501c48b7f080c48383970.tar.gz gitea-2bce24068dc3c64ee5e501c48b7f080c48383970.zip |
add Slack API webhook support
Diffstat (limited to 'modules')
-rw-r--r-- | modules/auth/repo_form.go | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 3eb0cbc564..5fd1114052 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -69,17 +69,31 @@ func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs *binding.Errors, l // \/ \/ \/ \/ \/ \/ type NewWebhookForm struct { - PayloadUrl string `form:"payload_url" binding:"Required;Url"` - ContentType string `form:"content_type" binding:"Required"` - Secret string `form:"secret"` - PushOnly bool `form:"push_only"` - Active bool `form:"active"` + HookTaskType string `form:"hook_type" binding:"Required"` + PayloadUrl string `form:"payload_url" binding:"Required;Url"` + ContentType string `form:"content_type" binding:"Required"` + Secret string `form:"secret"` + PushOnly bool `form:"push_only"` + Active bool `form:"active"` } func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) { validate(errs, ctx.Data, f, l) } +type NewSlackHookForm struct { + HookTaskType string `form:"hook_type" binding:"Required"` + Domain string `form:"domain" binding:"Required` + Token string `form:"token" binding:"Required"` + Channel string `form:"channel" binding:"Required"` + PushOnly bool `form:"push_only"` + Active bool `form:"active"` +} + +func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) { + validate(errs, ctx.Data, f, l) +} + // .___ // | | ______ ________ __ ____ // | |/ ___// ___/ | \_/ __ \ |