|
|
@ -43,28 +43,32 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
sframeChan.on('Q_SETTINGS_DRIVE_GET', function (d, cb) {
|
|
|
|
sframeChan.on('Q_SETTINGS_DRIVE_GET', function (d, cb) {
|
|
|
|
if (d === "full") {
|
|
|
|
|
|
|
|
// We want shared folders too
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Cryptpad.getUserObject(function (obj) {
|
|
|
|
Cryptpad.getUserObject(function (obj) {
|
|
|
|
if (obj.error) { return void cb(obj); }
|
|
|
|
if (obj.error) { return void cb(obj); }
|
|
|
|
var result = {
|
|
|
|
if (d === "full") {
|
|
|
|
uo: obj,
|
|
|
|
// We want shared folders too
|
|
|
|
sf: {}
|
|
|
|
var result = {
|
|
|
|
};
|
|
|
|
uo: obj,
|
|
|
|
if (!obj.drive || !obj.drive.sharedFolders) { return void cb(result); }
|
|
|
|
sf: {}
|
|
|
|
Utils.nThen(function (waitFor) {
|
|
|
|
};
|
|
|
|
Object.keys(obj.drive.sharedFolders).forEach(function (id) {
|
|
|
|
if (!obj.drive || !obj.drive.sharedFolders) { return void cb(result); }
|
|
|
|
Cryptpad.getSharedFolder(id, waitFor(function (obj) {
|
|
|
|
Utils.nThen(function (waitFor) {
|
|
|
|
result.sf[id] = obj;
|
|
|
|
Object.keys(obj.drive.sharedFolders).forEach(function (id) {
|
|
|
|
}));
|
|
|
|
Cryptpad.getSharedFolder(id, waitFor(function (obj) {
|
|
|
|
|
|
|
|
result.sf[id] = obj;
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}).nThen(function () {
|
|
|
|
|
|
|
|
cb(result);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).nThen(function () {
|
|
|
|
return;
|
|
|
|
cb(result);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// We want only the user object
|
|
|
|
|
|
|
|
cb(obj);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
sframeChan.on('Q_SETTINGS_DRIVE_SET', function (data, cb) {
|
|
|
|
sframeChan.on('Q_SETTINGS_DRIVE_SET', function (data, cb) {
|
|
|
|
|
|
|
|
if (data && data.uo) { data = data.uo; }
|
|
|
|
var sjson = JSON.stringify(data);
|
|
|
|
var sjson = JSON.stringify(data);
|
|
|
|
require([
|
|
|
|
require([
|
|
|
|
'/common/cryptget.js',
|
|
|
|
'/common/cryptget.js',
|
|
|
|