summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/post.go b/api/post.go
index 5cce766c0..354fe35db 100644
--- a/api/post.go
+++ b/api/post.go
@@ -61,7 +61,7 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) {
}
post.UserId = c.Session.UserId
- cchan := Srv.Store.Channel().Get(post.ChannelId)
+ cchan := Srv.Store.Channel().Get(post.ChannelId, true)
if !HasPermissionToChannelContext(c, post.ChannelId, model.PERMISSION_CREATE_POST) {
return
@@ -166,6 +166,7 @@ func CreatePost(c *Context, post *model.Post, triggerWebhooks bool) (*model.Post
}
}
+ InvalidateCacheForChannel(rpost.ChannelId)
InvalidateCacheForChannelPosts(rpost.ChannelId)
handlePostEvents(c, rpost, triggerWebhooks)
@@ -245,7 +246,7 @@ func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIc
func handlePostEvents(c *Context, post *model.Post, triggerWebhooks bool) {
tchan := Srv.Store.Team().Get(c.TeamId)
- cchan := Srv.Store.Channel().Get(post.ChannelId)
+ cchan := Srv.Store.Channel().Get(post.ChannelId, true)
uchan := Srv.Store.User().Get(post.UserId)
var team *model.Team