From 0519fec34e1ae179e63203a7f227fd514e588459 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Fri, 18 Oct 2019 22:04:22 +0530 Subject: [PATCH] Adding senderID to request filter --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d2ce98e..d8bf5e8 100644 --- a/index.html +++ b/index.html @@ -5355,11 +5355,11 @@ requestor = request[0]; request = JSON.parse(request[1]); if (floGlobals.storageList.includes(request.application)) - compactIDB.searchData(request.application, (k, v) => { return (v.application == request.application && (!request.receiverID || v.receiverID == request.receiverID) && (!request.type || v.type == request.type)) }, request.vectorClock, request.lastOnly) + compactIDB.searchData(request.application, (k, v) => { return (v.application == request.application && (!request.receiverID || v.receiverID == request.receiverID) && (!request.type || v.type == request.type) && (!request.senderIDs || request.senderIDs.includes(v.senderID))) }, request.vectorClock, request.lastOnly) .then(result => floSupernode.supernodeClientWS.send(`${requestor} ${JSON.stringify(result)}`)) .catch(error => console.log(error)) else - compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (v.application == request.application && (!request.receiverID || v.receiverID == request.receiverID) && (!request.type || v.type == request.type)) }, request.vectorClock, request.lastOnly) + compactIDB.searchData(floGlobals.defaultStorage, (k, v) => { return (v.application == request.application && (!request.receiverID || v.receiverID == request.receiverID) && (!request.type || v.type == request.type) && (!request.senderIDs || request.senderIDs.includes(v.senderID))) }, request.vectorClock, request.lastOnly) .then(result => floSupernode.supernodeClientWS.send(`${requestor} ${JSON.stringify(result)}`)) .catch(error => console.log(error))