Progress?

This commit is contained in:
Zach Fox 2017-10-04 12:33:58 -07:00
parent 23245e2fb9
commit ab08dc6bd6
7 changed files with 19 additions and 7 deletions

View file

@ -579,6 +579,7 @@ Rectangle {
}
rezzedNotifContainer.visible = true;
rezzedNotifContainerTimer.start();
commerce.updatePopLocation(root.itemId);
}
}
RalewaySemiBold {

View file

@ -343,6 +343,7 @@ Item {
if (urlHandler.canHandleUrl(root.itemHref)) {
urlHandler.handleUrl(root.itemHref);
}
commerce.updatePopLocation(root.itemId);
rezzedNotifContainer.visible = true;
rezzedNotifContainerTimer.start();
}

View file

@ -221,8 +221,8 @@ void Ledger::account() {
}
// The api/failResponse is called just for the side effect of logging.
void Ledger::updateLocationSuccess(QNetworkReply& reply) { apiResponse("reset", reply); }
void Ledger::updateLocationFailure(QNetworkReply& reply) { failResponse("reset", reply); }
void Ledger::updateLocationSuccess(QNetworkReply& reply) { apiResponse("updateLocation", reply); }
void Ledger::updateLocationFailure(QNetworkReply& reply) { failResponse("updateLocation", reply); }
void Ledger::updateLocation(const QString& asset_id, const QString location, const bool controlledFailure) {
auto wallet = DependencyManager::get<Wallet>();
QStringList keys = wallet->listPublicKeys();

View file

@ -149,3 +149,9 @@ void QmlCommerce::account() {
auto ledger = DependencyManager::get<Ledger>();
ledger->account();
}
void QmlCommerce::updatePopLocation(const QString& popId, const bool controlledFailure) {
auto ledger = DependencyManager::get<Ledger>();
auto nodeList = DependencyManager::get<NodeList>();
ledger->updateLocation(popId, nodeList->getDomainHandler().getUUID().toString(), controlledFailure);
}

View file

@ -70,6 +70,8 @@ protected:
Q_INVOKABLE void generateKeyPair();
Q_INVOKABLE void reset();
Q_INVOKABLE void account();
Q_INVOKABLE void updatePopLocation(const QString& popId, const bool controlledFailure = false);
};
#endif // hifi_QmlCommerce_h

View file

@ -1107,9 +1107,6 @@ void EntityTree::popStatusSuccess(QNetworkReply& reply) {
// qCDebug(entities) << "'transfer_status' is 'failed', deleting entity" << entityItemID;
// deleteEntity(entityItemID, true);
//} else {
// //auto challengeOwnershipPacket = NLPacket::create(PacketType::ChallengeOwnership, NUM_BYTES_RFC4122_UUID + sizeof(encryptedText));
// //challengeOwnershipPacket->write(senderNode->getUUID());
// //challengeOwnershipPacket->writePrimitive(KillAvatarReason::TheirAvatarEnteredYourBubble);
//}
}
@ -1358,9 +1355,15 @@ int EntityTree::processEditPacketData(ReceivedMessage& message, const unsigned c
qCDebug(entities) << "Sending" << endpoint << QJsonDocument(request).toJson(QJsonDocument::Compact);
accountManager->sendRequest(URL + endpoint,
AccountManagerAuth::None,
QNetworkAccessManager::PostOperation,
QNetworkAccessManager::GetOperation,
callbackParams,
QJsonDocument(request).toJson());
// Second, challenge ownership of the PoP cert
//auto challengeOwnershipPacket = NLPacket::create(PacketType::ChallengeOwnership, NUM_BYTES_RFC4122_UUID + sizeof(encryptedText));
//challengeOwnershipPacket->write(senderNode->getUUID());
//challengeOwnershipPacket->writePrimitive(KillAvatarReason::TheirAvatarEnteredYourBubble);
//// Kickoff a 10-second timeout timer that deletes the entity if we don't get an ownership response in time
}
}

View file

@ -18,7 +18,6 @@
#include "AccountManager.h"
#include <QJsonObject>
#include <QJsonDocument>
#include <QtNetwork/QNetworkReply>
#include <Octree.h>
#include <SpatialParentFinder.h>