diff options
Diffstat (limited to 'app/post.go')
-rw-r--r-- | app/post.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/post.go b/app/post.go index 01581c748..841048cbc 100644 --- a/app/post.go +++ b/app/post.go @@ -48,6 +48,12 @@ func CreatePostAsUser(post *model.Post) (*model.Post, *model.AppError) { if result := <-Srv.Store.Channel().UpdateLastViewedAt([]string{post.ChannelId}, post.UserId); result.Err != nil { l4g.Error(utils.T("api.post.create_post.last_viewed.error"), post.ChannelId, post.UserId, result.Err) } + + if *utils.Cfg.ServiceSettings.EnablChannelViewedMessages { + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", post.UserId, nil) + message.Add("channel_id", post.ChannelId) + go Publish(message) + } } return rp, nil |