Skip to content

Commit

Permalink
The response to websocket messages wasn't conform with the definition…
Browse files Browse the repository at this point in the history
… in #35 because the answer should be like {"Command":command,"answer":{answerObject}}.
  • Loading branch information
RaHoni committed Oct 2, 2020
1 parent 5a64dd4 commit 9b6ceb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/PrivateHome/UI/Websocket/websocket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object websocket {
case e => ("error" -> "Unknown Command") ~ ("command" -> e) ~ ("msg" -> msgText)
}
answer match {
case jObject: JObject => sendMsg(websocketId, jObject)
case jObject: JObject => sendMsg(websocketId, ("Command" -> commandType) ~ ("answer" -> jObject))
case _ => //This ensures that this flow is completed and the source is cleaned so that new Messages can be handled
}

Expand Down

0 comments on commit 9b6ceb5

Please sign in to comment.