From d75c0a00bb97bfee9cad7f9c4f3af6a601ceba29 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 12 Oct 2017 16:29:05 -0700 Subject: [PATCH] Closer than ever --- assignment-client/src/entities/EntityServer.cpp | 8 +------- assignment-client/src/entities/EntityServer.h | 1 + interface/src/commerce/Wallet.cpp | 2 +- libraries/entities/src/EntityTree.cpp | 8 ++------ libraries/entities/src/EntityTree.h | 1 + 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/assignment-client/src/entities/EntityServer.cpp b/assignment-client/src/entities/EntityServer.cpp index 475c911bb8..47d51e8d77 100644 --- a/assignment-client/src/entities/EntityServer.cpp +++ b/assignment-client/src/entities/EntityServer.cpp @@ -478,14 +478,8 @@ void EntityServer::startDynamicDomainVerification() { QJsonObject jsonObject = QJsonDocument::fromJson(networkReply->readAll()).object(); jsonObject = jsonObject["data"].toObject(); - // ZRF FIXME Remove these two lines - QJsonDocument doc(jsonObject); - qCDebug(entities) << "ZRF FIXME" << doc.toJson(QJsonDocument::Compact); - if (networkReply->error() == QNetworkReply::NoError) { - // ZRF FIXME!!! - //if (jsonObject["place_name"].toString() != thisPlaceName) { - if (false) { + if (jsonObject["location"].toArray().first().toString() != thisPlaceName) { qCDebug(entities) << "Entity's cert's place name" << jsonObject["place_name"].toString() << "isn't the current place name" << thisPlaceName << "; deleting entity" << i.value(); tree->deleteEntity(i.value(), true); diff --git a/assignment-client/src/entities/EntityServer.h b/assignment-client/src/entities/EntityServer.h index 5cebd9b751..408fad4494 100644 --- a/assignment-client/src/entities/EntityServer.h +++ b/assignment-client/src/entities/EntityServer.h @@ -19,6 +19,7 @@ #include "EntityItem.h" #include "EntityServerConsts.h" #include "EntityTree.h" +#include /// Handles assignments of type EntityServer - sending entities to various clients. diff --git a/interface/src/commerce/Wallet.cpp b/interface/src/commerce/Wallet.cpp index 0bdb3c03ec..64b9922022 100644 --- a/interface/src/commerce/Wallet.cpp +++ b/interface/src/commerce/Wallet.cpp @@ -739,7 +739,7 @@ void Wallet::handleChallengeOwnershipPacket(QSharedPointer pack if (decryptionStatus != -1) { auto nodeList = DependencyManager::get(); - QByteArray decryptedTextByteArray = QByteArray(reinterpret_cast(decryptedText), (int)strlen((char*)decryptedText)); + QByteArray decryptedTextByteArray = QByteArray(reinterpret_cast(decryptedText), decryptionStatus); int decryptedTextByteArraySize = decryptedTextByteArray.size(); int certIDSize = certID.size(); // setup the packet diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 69b7e5ab33..341637606f 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1229,18 +1229,14 @@ void EntityTree::validatePop(const QString& certID, const EntityItemID& entityIt QJsonObject jsonObject = QJsonDocument::fromJson(networkReply->readAll()).object(); jsonObject = jsonObject["data"].toObject(); - // ZRF FIXME Remove these two lines - QJsonDocument doc(jsonObject); - qCDebug(entities) << "ZRF FIXME" << doc.toJson(QJsonDocument::Compact); - if (networkReply->error() == QNetworkReply::NoError) { if (!jsonObject["invalid_reason"].toString().isEmpty()) { qCDebug(entities) << "invalid_reason not empty, deleting entity" << entityItemID; deleteEntity(entityItemID, true); - } else if (jsonObject["transfer_status"].toString() == "failed") { + } else if (jsonObject["transfer_status"].toArray().first().toString() == "failed") { qCDebug(entities) << "'transfer_status' is 'failed', deleting entity" << entityItemID; deleteEntity(entityItemID, true); - } else if (jsonObject["transfer_status"].toString() == "pending") { + } else if (jsonObject["transfer_status"].toArray().first().toString() == "pending") { if (isRetryingValidation) { qCDebug(entities) << "'transfer_status' is 'pending' after retry, deleting entity" << entityItemID; deleteEntity(entityItemID, true); diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 00a601d684..8d939159ce 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -18,6 +18,7 @@ #include "AccountManager.h" #include #include +#include #include #include