Add more migration options

This commit is contained in:
yflory
2019-10-28 18:22:42 +01:00
parent f6bbe70f3c
commit 176e667128
4 changed files with 41 additions and 23 deletions

View File

@@ -77,7 +77,7 @@ define([
// If this pad has a visible href, encrypt it
// "&& data.roHref" is here to make sure this is not a "file"
if (data.href && data.roHref && !data.fileType) {
var _href = oldCryptor.decrypt(data.href);
var _href = (data.href && data.href.indexOf('#') === -1) ? oldCryptor.decrypt(data.href) : data.href;
data.href = newCryptor.encrypt(_href);
}
});
@@ -85,7 +85,7 @@ define([
var data = obj[SHARED_FOLDERS][id] || {};
// If this folder has a visible href, encrypt it
if (data.href) {
var _href = oldCryptor.decrypt(data.href);
var _href = (data.href && data.href.indexOf('#') === -1) ? oldCryptor.decrypt(data.href) : data.href;
data.href = newCryptor.encrypt(_href);
}
});
@@ -93,7 +93,7 @@ define([
var data = obj[SHARED_FOLDERS_TEMP][id] || {};
// If this folder has a visible href, encrypt it
if (data.href) {
var _href = oldCryptor.decrypt(data.href);
var _href = (data.href && data.href.indexOf('#') === -1) ? oldCryptor.decrypt(data.href) : data.href;
data.href = newCryptor.encrypt(_href);
}
});
@@ -102,6 +102,10 @@ define([
module.init = function (files, config) {
var exp = {};
if (false && !files.version) { // XXX if we remove false, old shared folders won't encrypt new hrefs
config.editKey = undefined;
}
exp.cryptor = createCryptor(config.editKey);
exp.setReadOnly = function (state, key) {