summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/ctrlWebSocket.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWebSocket.go')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWebSocket.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSocket.go b/src/helsinki.at/rhimportd/ctrlWebSocket.go
index da2978e..4c1bf45 100644
--- a/src/helsinki.at/rhimportd/ctrlWebSocket.go
+++ b/src/helsinki.at/rhimportd/ctrlWebSocket.go
@@ -192,10 +192,10 @@ func webSocketDone(res rhimport.ImportResult, userdata interface{}) bool {
return true
}
-func (self *webSocketSession) startNewSession(reqdata *webSocketRequestData, conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan) (int, string) {
- ctx := rhimport.NewImportContext(conf, rddb, reqdata.UserName)
+func (self *webSocketSession) startNewSession(reqdata *webSocketRequestData, conf *rhimport.Config, sessions *rhimport.SessionStoreChan) (int, string) {
+ ctx := rhimport.NewImportContext(conf, nil, reqdata.UserName)
ctx.Password = reqdata.Password
- ctx.Trusted = true // TODO: set this to false as soon as the interface is working
+ ctx.Trusted = false
ctx.ShowId = reqdata.ShowId
ctx.ClearShowCarts = reqdata.ClearShowCarts
ctx.GroupName = reqdata.MusicPoolGroup
@@ -243,7 +243,7 @@ func (self *webSocketSession) reconnectSession(reqdata *webSocketRequestData, se
return http.StatusOK, "SUCCESS"
}
-func webSocketSessionHandler(reqchan <-chan webSocketRequestData, ws *websocket.Conn, conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan) {
+func webSocketSessionHandler(reqchan <-chan webSocketRequestData, ws *websocket.Conn, conf *rhimport.Config, sessions *rhimport.SessionStoreChan) {
defer ws.Close()
session := newWebSocketSession()
@@ -258,7 +258,7 @@ func webSocketSessionHandler(reqchan <-chan webSocketRequestData, ws *websocket.
if session.id != "" {
sendWebSocketErrorResponse(ws, http.StatusBadRequest, "This connection already handles a session")
} else {
- code, errstring := session.startNewSession(&reqdata, conf, rddb, sessions)
+ code, errstring := session.startNewSession(&reqdata, conf, sessions)
if code != http.StatusOK {
sendWebSocketErrorResponse(ws, code, errstring)
} else {
@@ -283,7 +283,7 @@ func webSocketSessionHandler(reqchan <-chan webSocketRequestData, ws *websocket.
}
}
case "list":
- list, code, errstring := sessions.List(reqdata.UserName, reqdata.Password, true) // TODO: set this to false as soon as the interface is working
+ list, code, errstring := sessions.List(reqdata.UserName, reqdata.Password, false)
if code != http.StatusOK {
sendWebSocketErrorResponse(ws, code, errstring)
} else {
@@ -314,7 +314,7 @@ func webSocketHandler(conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *
}
rhdl.Println("WebSocket Client", ws.RemoteAddr(), "connected")
reqchan := make(chan webSocketRequestData)
- go webSocketSessionHandler(reqchan, ws, conf, rddb, sessions)
+ go webSocketSessionHandler(reqchan, ws, conf, sessions)
defer close(reqchan)
for {