From 9ef02410fda13bffd6ff2fc7172d19d1f7c25a94 Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Wed, 30 May 2018 14:52:14 +0200 Subject: Add flag for data loaded from cache --- src/DatabaseStorage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/DatabaseStorage.cpp b/src/DatabaseStorage.cpp index 6e4046d..407aa5c 100644 --- a/src/DatabaseStorage.cpp +++ b/src/DatabaseStorage.cpp @@ -241,7 +241,8 @@ namespace odhtdb const DataView adminGroupRaw = nodeQuery.getBlob(2); memcpy(adminGroupId, adminGroupRaw.data, GROUP_ID_LENGTH); - const DatabaseCreateNodeRequest createNodeRequest(&nodeHash, timestamp, &creatorPublicKey, DataView(adminGroupId, GROUP_ID_LENGTH)); + DatabaseCreateNodeRequest createNodeRequest(&nodeHash, timestamp, &creatorPublicKey, DataView(adminGroupId, GROUP_ID_LENGTH)); + createNodeRequest.loadedFromCache = true; database->onCreateNodeCallbackFunc(createNodeRequest); } } @@ -288,7 +289,8 @@ namespace odhtdb OwnedByteArray decryptedData(new u8[decryptedDataSize], decryptedDataSize); memcpy(decryptedData.data, decryptedDataRaw, decryptedDataSize); - const DatabaseAddNodeRequest addNodeRequest(&nodeHash, &requestHash, timestamp, &creatorPublicKey, DataView(decryptedData.data, decryptedData.size)); + DatabaseAddNodeRequest addNodeRequest(&nodeHash, &requestHash, timestamp, &creatorPublicKey, DataView(decryptedData.data, decryptedData.size)); + addNodeRequest.loadedFromCache = true; database->onAddNodeCallbackFunc(addNodeRequest); } else if(operation == DatabaseOperation::ADD_USER) @@ -317,6 +319,7 @@ namespace odhtdb memcpy(groupToAddUserTo, groupToAddUserToRaw, GROUP_ID_LENGTH); DatabaseAddUserRequest addUserRequest(&nodeHash, &requestHash, timestamp, &creatorPublicKey, &userToAddPublicKey, DataView(groupToAddUserTo, GROUP_ID_LENGTH)); + addUserRequest.loadedFromCache = true; database->onAddUserCallbackFunc(addUserRequest); } } -- cgit v1.2.3