aboutsummaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-04 06:13:25 +0800
committerzeripath <art27@cantab.net>2019-11-03 22:13:25 +0000
commita966a0298ea1a545c383541ca4e72c61de1ed59e (patch)
tree95e327a9c8df47f1c343f8bad210ae6cdd208483 /models/webhook.go
parent491887d44132b8103ed0d753f95ecd43d600adba (diff)
downloadgitea-a966a0298ea1a545c383541ca4e72c61de1ed59e.tar.gz
gitea-a966a0298ea1a545c383541ca4e72c61de1ed59e.zip
Move more webhook codes from models to webhook module (#8802)
* Move more webhook codes from models to webhook module
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/models/webhook.go b/models/webhook.go
index d3a8b52d86..7eb17caaf6 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -118,33 +118,6 @@ func (w *Webhook) AfterLoad() {
}
}
-// GetSlackHook returns slack metadata
-func (w *Webhook) GetSlackHook() *SlackMeta {
- s := &SlackMeta{}
- if err := json.Unmarshal([]byte(w.Meta), s); err != nil {
- log.Error("webhook.GetSlackHook(%d): %v", w.ID, err)
- }
- return s
-}
-
-// GetDiscordHook returns discord metadata
-func (w *Webhook) GetDiscordHook() *DiscordMeta {
- s := &DiscordMeta{}
- if err := json.Unmarshal([]byte(w.Meta), s); err != nil {
- log.Error("webhook.GetDiscordHook(%d): %v", w.ID, err)
- }
- return s
-}
-
-// GetTelegramHook returns telegram metadata
-func (w *Webhook) GetTelegramHook() *TelegramMeta {
- s := &TelegramMeta{}
- if err := json.Unmarshal([]byte(w.Meta), s); err != nil {
- log.Error("webhook.GetTelegramHook(%d): %v", w.ID, err)
- }
- return s
-}
-
// History returns history of webhook by given conditions.
func (w *Webhook) History(page int) ([]*HookTask, error) {
return HookTasks(w.ID, page)