websocket: don't send initial data unless logged in

This commit is contained in:
Tulir Asokan 2024-10-26 14:30:14 +03:00
parent 2c92a69400
commit 96b11fca8e

View file

@ -202,7 +202,9 @@ func (gmx *Gomuks) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
return
}
go sendImageAuthToken()
go gmx.sendInitialData(ctx, conn)
if gmx.Client.IsLoggedIn() {
go gmx.sendInitialData(ctx, conn)
}
log.Debug().Msg("Connection initialization complete")
var closeErr websocket.CloseError
for {