From f1107ae6e53357c6b647a958db23d7aacd7eb77c Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 16 Mar 2018 18:13:33 +0100 Subject: [PATCH] Don't count other people's owned pads against your limit --- www/common/outer/async-store.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 4f1431e32..ffd31f1b6 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -69,8 +69,16 @@ define([ var userChannel = userParsedHash && userParsedHash.channel; if (!userChannel) { return null; } - var list = store.userObject.getFiles([store.userObject.FILES_DATA]).map(function (id) { - return Hash.hrefToHexChannelId(store.userObject.getFileData(id).href); + // Get the list of pads' channel ID in your drive + // This list is filtered so that it doesn't include pad owned by other users (you should + // not pin these pads) + var files = store.userObject.getFiles([store.userObject.FILES_DATA]); + var edPublic = store.proxy.edPublic; + var list = files.map(function (id) { + var d = store.userObject.getFileData(id); + if (d.owners && d.owners.length && edPublic && + d.owners.indexOf(edPublic) === -1) { return; } + return Hash.hrefToHexChannelId(d.href); }) .filter(function (x) { return x; });