From 345bfc1cea00f8d00bf693881ce0233059d51ec2 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 26 Sep 2017 14:36:49 +0200 Subject: [PATCH] Remove migration for pad attributes --- www/common/migrate-user-object.js | 32 ++----------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/www/common/migrate-user-object.js b/www/common/migrate-user-object.js index 5ac2ceac7..c9c3bbd01 100644 --- a/www/common/migrate-user-object.js +++ b/www/common/migrate-user-object.js @@ -7,41 +7,13 @@ define([], function () { return function (userObject, Cryptpad) { var version = userObject.version || 0; + // DEPRECATED // Migration 1: pad attributes moved to filesData var migratePadAttributesToData = function () { - var files = userObject && userObject.drive; - if (!files) { return; } - - var migratePadAttributes = function (el, id, parsed) { - // Migrate old pad attributes - ['userid', 'previewMode'].forEach(function (attr) { - var key = parsed.hash + '.' + attr; - var key2 = parsed.hash.slice(0,-1) + '.' + attr;// old pads not ending with / - if (typeof(files[key]) !== "undefined" || typeof(files[key2]) !== "undefined") { - console.log("Migrating pad attribute", attr, "for pad", id); - el[attr] = files[key] || files[key2]; - delete files[key]; - delete files[key2]; - } - }); - }; - var filesData = files.filesData; - if (!filesData) { return; } - - var el, parsed; - for (var id in filesData) { - id = Number(id); - el = filesData[id]; - parsed = el.href && Cryptpad.parsePadUrl(el.href); - if (!parsed) { continue; } - migratePadAttributes(el, id, parsed); - } - // Migration done + return true; }; if (version < 1) { migratePadAttributesToData(); - Cryptpad.feedback('Migrate-1', true); - userObject.version = version = 1; } // Migration 2: global attributes from root to 'settings' subobjects