From 39675afab4ba6e22b834aa6ff8d7dab2a35c5a8d Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 10 Nov 2016 09:20:36 -0500 Subject: Only send WS hello event once authenticated (#4509) --- api/web_hub.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api/web_hub.go') 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) { -- cgit v1.2.3-1-g7c22