implement getUserChannelList

This commit is contained in:
ansuz 2017-03-15 15:55:55 +01:00
parent 61fc4a3f86
commit 7187d3c550
1 changed files with 22 additions and 0 deletions

View File

@ -987,6 +987,28 @@ define([
});
*/
};
var getUserChannelList = common.getUserChannelList = function () {
var store = common.getStore();
var proxy = store.getProxy();
var fo = proxy.fo;
var list = fo.getFilesDataFiles().map(function (href) {
var parsed = Cryptpad.parsePadUrl(href);
if (!parsed || !parsed.hash) { return; }
parsed = Cryptpad.parseHash(parsed.hash);
var channel = parsed.channel;
if (!channel) { return; }
var hex = Cryptpad.base64ToHex(channel);
return hex;
}).filter(function (x) { return x; }).sort();
return list;
};
var createButton = common.createButton = function (type, rightside, data, callback) {
var button;
var size = "17px";