diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-04 06:13:25 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-11-03 22:13:25 +0000 |
commit | a966a0298ea1a545c383541ca4e72c61de1ed59e (patch) | |
tree | 95e327a9c8df47f1c343f8bad210ae6cdd208483 /models/webhook.go | |
parent | 491887d44132b8103ed0d753f95ecd43d600adba (diff) | |
download | gitea-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.go | 27 |
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) |