From eb7561e05bb797a0f925ac69079040016926eef5 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 29 Jun 2017 07:51:15 -0700 Subject: PLT-6610 sending websocket event for last channel viewed (#6787) --- app/post.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/post.go') 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 -- cgit v1.2.3-1-g7c22