From d85a42c776e9c899da11d0514d9ae842878def2c Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 16 Mar 2017 14:43:57 +0100 Subject: [PATCH] include User_hash in user channel list --- www/common/cryptpad-common.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 3b7e756c6..5519916e5 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1004,6 +1004,13 @@ define([ var proxy = store.getProxy(); var fo = proxy.fo; + // start with your userHash... + var userHash = localStorage && localStorage.User_hash; + if (!userHash) { return null; } + + var userChannel = common.parseHash(userHash).channel; + if (!userChannel) { return null; } + var list = fo.getFilesDataFiles().map(function (href) { var parsed = common.parsePadUrl(href); if (!parsed || !parsed.hash) { return; } @@ -1015,7 +1022,10 @@ define([ var hex = common.base64ToHex(channel); return hex; - }).filter(function (x) { return x; }).sort(); + }).filter(function (x) { return x; }); + + list.push(userChannel); + list.sort(); return list; };