summaryrefslogtreecommitdiffstats
path: root/api/webhook.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-27 14:07:34 -0500
committerGitHub <noreply@github.com>2017-01-27 14:07:34 -0500
commit097289f8e473c799ee752aa56e08f605110f5217 (patch)
tree424cd42d691b28d1c08852dc02a69d69f2b70a65 /api/webhook.go
parent8eab04e944b3874f1fc4985344cbccec84c6002a (diff)
downloadchat-097289f8e473c799ee752aa56e08f605110f5217.tar.gz
chat-097289f8e473c799ee752aa56e08f605110f5217.tar.bz2
chat-097289f8e473c799ee752aa56e08f605110f5217.zip
Merge 3.6.2 into master (#5211)
* Add webhook cache * Add channel by name cache * Fxing profiles in channels cache * Fix merge
Diffstat (limited to 'api/webhook.go')
-rw-r--r--api/webhook.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/api/webhook.go b/api/webhook.go
index 5d36409eb..248df6726 100644
--- a/api/webhook.go
+++ b/api/webhook.go
@@ -109,7 +109,7 @@ func deleteIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if result := <-app.Srv.Store.Webhook().GetIncoming(id); result.Err != nil {
+ if result := <-app.Srv.Store.Webhook().GetIncoming(id, true); result.Err != nil {
c.Err = result.Err
return
} else {
@@ -125,6 +125,8 @@ func deleteIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ app.InvalidateCacheForWebhook(id)
+
c.LogAudit("success")
w.Write([]byte(model.MapToJson(props)))
}
@@ -352,7 +354,7 @@ func incomingWebhook(c *Context, w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
id := params["id"]
- hchan := app.Srv.Store.Webhook().GetIncoming(id)
+ hchan := app.Srv.Store.Webhook().GetIncoming(id, true)
r.ParseForm()
@@ -448,7 +450,7 @@ func incomingWebhook(c *Context, w http.ResponseWriter, r *http.Request) {
channelName = channelName[1:]
}
- cchan = app.Srv.Store.Channel().GetByName(hook.TeamId, channelName)
+ cchan = app.Srv.Store.Channel().GetByName(hook.TeamId, channelName, true)
} else {
cchan = app.Srv.Store.Channel().Get(hook.ChannelId, true)
}