summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-09-15 06:56:08 -0400
committerGeorge Goldberg <george@gberg.me>2017-09-15 11:56:08 +0100
commit600beb5af3e35fd82a2b06995b67629d08fe0fe3 (patch)
tree1bb4b6b99420aff52c1efec5631f3094a927c2a9 /app/channel.go
parentb6fb98a43176215f16fc52b64abebde51355e5c1 (diff)
downloadchat-600beb5af3e35fd82a2b06995b67629d08fe0fe3.tar.gz
chat-600beb5af3e35fd82a2b06995b67629d08fe0fe3.tar.bz2
chat-600beb5af3e35fd82a2b06995b67629d08fe0fe3.zip
Add some checking of channel ID before sending websocket event (#7431)
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/channel.go b/app/channel.go
index fa9ac08ef..e7025633f 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -1168,7 +1168,7 @@ func (a *App) ViewChannel(view *model.ChannelView, userId string, clearPushNotif
return result.Err
}
- if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages && len(view.ChannelId) > 0 {
+ if *utils.Cfg.ServiceSettings.EnableChannelViewedMessages && model.IsValidId(view.ChannelId) {
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_VIEWED, "", "", userId, nil)
message.Add("channel_id", view.ChannelId)
go Publish(message)