History

changing back to avatar only and making some changes to avoid multiple calls to dependency manager

Liv Erickson committed 8 years ago

Commit f8f76d61 parent 6a971e14 files · +13 −16Browse files

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

Unified · Split

interface/src/scripting/WalletScriptingInterface.cpp+11−13
@@ -17,14 +17,6 @@ CheckoutProxy::CheckoutProxy(QObject* qmlObject, QObject* parent) : QmlWrapper(q · 16 unmodified lines
1717
1818 WalletScriptingInterface::WalletScriptingInterface() {
1919
20− _entityPropertyFlags += PROP_POSITION;
21− _entityPropertyFlags += PROP_ROTATION;
22− _entityPropertyFlags += PROP_MARKETPLACE_ID;
23− _entityPropertyFlags += PROP_DIMENSIONS;
24− _entityPropertyFlags += PROP_REGISTRATION_POINT;
25− _entityPropertyFlags += PROP_CERTIFICATE_ID;
26− _entityPropertyFlags += PROP_CLIENT_ONLY;
27− _entityPropertyFlags += PROP_OWNING_AVATAR_ID;
2820 }
2921
3022 void WalletScriptingInterface::refreshWalletStatus() {
@@ -37,11 +29,17 @@ void WalletScriptingInterface::setWalletStatus(const uint& status) { · 6 unmodified lines
3729 emit DependencyManager::get<Wallet>()->walletStatusResult(status);
3830 }
3931
40−void WalletScriptingInterface::proveEntityOwnershipVerification(const QUuid& entityID) {
41− EntityItemProperties entityProperties = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(entityID, _entityPropertyFlags);
42− if (!entityID.isNull() && entityProperties.getMarketplaceID().length() > 0) {
43− DependencyManager::get<ContextOverlayInterface>()->requestOwnershipVerification(entityID);
32+void WalletScriptingInterface::proveAvatarEntityOwnershipVerification(const QUuid& entityID) {
33+ QSharedPointer<ContextOverlayInterface> contextOverlayInterface = DependencyManager::get<ContextOverlayInterface>();
34+ EntityItemProperties entityProperties = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(entityID,
35+ contextOverlayInterface->getEntityPropertyFlags());
36+ if (entityProperties.getClientOnly()) {
37+ if (!entityID.isNull() && entityProperties.getCertificateID().length() > 0) {
38+ contextOverlayInterface->requestOwnershipVerification(entityID);
39+ } else {
40+ qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is null or not a certified item";
41+ }
4442 } else {
45− qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is null or not a marketplace item";
43+ qCDebug(entities) << "Failed to prove ownership of:" << entityID << "is not an avatar entity";
4644 }
4745 }