diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-11-10 09:20:36 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-10 09:20:36 -0500 |
commit | 39675afab4ba6e22b834aa6ff8d7dab2a35c5a8d (patch) | |
tree | fc3888fca22d64a3121902be09233337f74622d8 /api/web_hub.go | |
parent | 70e0d5c298de3383e43f9b5df41d7e8f0e3ffb6e (diff) | |
download | chat-39675afab4ba6e22b834aa6ff8d7dab2a35c5a8d.tar.gz chat-39675afab4ba6e22b834aa6ff8d7dab2a35c5a8d.tar.bz2 chat-39675afab4ba6e22b834aa6ff8d7dab2a35c5a8d.zip |
Only send WS hello event once authenticated (#4509)
Diffstat (limited to 'api/web_hub.go')
-rw-r--r-- | api/web_hub.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/web_hub.go b/api/web_hub.go index e59521879..73b94bf1d 100644 --- a/api/web_hub.go +++ b/api/web_hub.go @@ -119,9 +119,9 @@ func InvalidateCacheForUserSkipClusterSend(userId string) { func (h *Hub) Register(webConn *WebConn) { h.register <- webConn - msg := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_HELLO, "", "", webConn.UserId, nil) - msg.Add("server_version", fmt.Sprintf("%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash)) - go Publish(msg) + if webConn.isAuthenticated() { + webConn.SendHello() + } } func (h *Hub) Unregister(webConn *WebConn) { |