diff --git a/source/connection/connection.d b/source/connection/connection.d index b6b5699..a4edb03 100644 --- a/source/connection/connection.d +++ b/source/connection/connection.d @@ -199,13 +199,8 @@ public final class BesterConnection : Thread try { - /* Provide the following "data" : ..., "from" : username */ - JSONValue handlerInput; - handlerInput["data"] = payloadData; - handlerInput["from"] = username; - /* Provide the handler the message and let it process it and send us a reply */ - HandlerResponse handlerResponse = chosenHandler.handleMessage(handlerInput); + HandlerResponse handlerResponse = chosenHandler.handleMessage(payloadData); /* TODO: Continue here, we will make all error handling do on construction as to make this all more compact */ debugPrint("<<< Message Handler [" ~ chosenHandler.getPluginName() ~ "] response >>>\n\n" ~ handlerResponse.toString()); diff --git a/source/handlers/response.d b/source/handlers/response.d index eedb004..a74a49e 100644 --- a/source/handlers/response.d +++ b/source/handlers/response.d @@ -167,19 +167,19 @@ public final class HandlerResponse /* The fully response message to send back */ JSONValue clientPayload; - /* Set the `handlerName` field of the header block */ - JSONValue handlerName; - handlerName["handlerName"] = handler.getPluginName(); + // /* Set the `handlerName` field of the header block */ + // JSONValue handlerName; + // handlerName["handlerName"] = handler.getPluginName(); /* Set the header of the response */ - JSONValue headerBlock = handlerName; + JSONValue headerBlock; clientPayload["header"] = headerBlock; /* Set the payload of the response */ JSONValue payloadBlock; payloadBlock["data"] = messageResponse["data"]; payloadBlock["type"] = handler.getPluginName(); - clientPayload["data"] = payloadBlock; + clientPayload["payload"] = payloadBlock; /** @@ -240,7 +240,7 @@ public final class HandlerResponse /* Set the header of the response */ JSONValue headerBlock; - headerBlock["handlerName"] = handler.getPluginName(); + // headerBlock["handlerName"] = handler.getPluginName(); headerBlock["scope"] = "server"; serverPayload["header"] = headerBlock;