diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 25b1a320f..1204e3e27 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -80,6 +80,40 @@ define([ }); }; + + common.getTeamsId = function () { + postMessage("GET", { + key: ['teams'], + }, function (obj) { + if (obj.error) { return; } + Object.keys(obj || {}).forEach(function (id) { + console.log(obj[id].metadata.name, ':', id); + }); + }); + + }; + common.fixFork = function (teamId) { + var i = 0; + var send = function () { + if (i >= 110) { + postMessage("SET", { + teamId: teamId, + key: ['fixFork'], + }, function () {}); + return; + } + postMessage("SET", { + teamId: teamId, + key: ['fixFork'], + value: i + }, function () { + i++; + setTimeout(send, 500); + }); + }; + send(); + }; + // RESTRICTED // Settings only common.resetDrive = function (cb) {