History

moving logic to wallet, crashes currently

Liv Erickson committed 8 years ago

Commit 20635ac1 parent 3a6f1844 files · +32 −17Browse files

Showing the changes to interface/src/scripting/WalletScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

interface/src/scripting/WalletScriptingInterface.cpp+22−0
@@ -16,6 +16,16 @@ CheckoutProxy::CheckoutProxy(QObject* qmlObject, QObject* parent) : QmlWrapper(q · 15 unmodified lines
1616 }
1717
1818 WalletScriptingInterface::WalletScriptingInterface() {
19+ _contextOverlayInterface = DependencyManager::get<ContextOverlayInterface>();
20+
21+ _entityPropertyFlags += PROP_POSITION;
22+ _entityPropertyFlags += PROP_ROTATION;
23+ _entityPropertyFlags += PROP_MARKETPLACE_ID;
24+ _entityPropertyFlags += PROP_DIMENSIONS;
25+ _entityPropertyFlags += PROP_REGISTRATION_POINT;
26+ _entityPropertyFlags += PROP_CERTIFICATE_ID;
27+ _entityPropertyFlags += PROP_CLIENT_ONLY;
28+ _entityPropertyFlags += PROP_OWNING_AVATAR_ID;
1929 }
2030
2131 void WalletScriptingInterface::refreshWalletStatus() {
@@ -26,4 +36,16 @@ void WalletScriptingInterface::refreshWalletStatus() { · 4 unmodified lines
2636 void WalletScriptingInterface::setWalletStatus(const uint& status) {
2737 _walletStatus = status;
2838 emit DependencyManager::get<Wallet>()->walletStatusResult(status);
39+}
40+
41+void WalletScriptingInterface::proveAvatarEntityOwnershipVerification(const QUuid& entityID) {
42+ EntityItemProperties entityProperties = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(entityID, _entityPropertyFlags);
43+ if (!entityID.isNull() && entityProperties.getMarketplaceID().length() > 0) {
44+ if (!entityProperties.getClientOnly()) {
45+ qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is not an avatar entity";
46+ emit _contextOverlayInterface->ownershipVerificationFailed(entityID);
47+ return;
48+ }
49+ _contextOverlayInterface->requestOwnershipVerification(entityID);
50+ }
2951 }