Fix API Subscription initialisation (#1354)

* Fix #1352,#1351

* Fix/Add details on client address
This commit is contained in:
LordGrey
2021-10-16 13:55:23 +02:00
committed by GitHub
parent 532ac7e330
commit c9a7258160
6 changed files with 20 additions and 5 deletions

View File

@@ -98,6 +98,8 @@ void JsonAPI::initialize()
{
// init API, REQUIRED!
API::init();
// Initialise jsonCB with current instance
_jsonCB->setSubscriptionsTo(_hyperion);
// setup auth interface
connect(this, &API::onPendingTokenRequest, this, &JsonAPI::newPendingTokenRequest);
@@ -129,6 +131,8 @@ void JsonAPI::handleMessage(const QString &messageString, const QString &httpAut
{
const QString ident = "JsonRpc@" + _peerAddress;
QJsonObject message;
//std::cout << "JsonAPI::handleMessage | [" << static_cast<int>(_hyperion->getInstanceIndex()) << "] Received: ["<< messageString.toStdString() << "]" << std::endl;
// parse the message
if (!JsonUtils::parse(ident, messageString, message, _log))
{