diff options
Diffstat (limited to 'api/websocket.go')
-rw-r--r-- | api/websocket.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/api/websocket.go b/api/websocket.go index 5f390395d..5c0858910 100644 --- a/api/websocket.go +++ b/api/websocket.go @@ -34,7 +34,11 @@ func connect(c *Context, w http.ResponseWriter, r *http.Request) { } wc := app.NewWebConn(ws, c.Session, c.T, c.Locale) - app.HubRegister(wc) + + if len(c.Session.UserId) > 0 { + app.HubRegister(wc) + } + go wc.WritePump() wc.ReadPump() } |