From 1e0de620be85b7b4d8af1472a52a851933a921d0 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 23:08:17 +0100 Subject: more author logic --- src/node/utils/ImportEtherpad.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/node') diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index be6a8929..f3d3c4b0 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -23,10 +23,19 @@ exports.setPadRaw = function(padId, records, callback){ async.eachSeries(Object.keys(records), function(key, cb){ var value = records[key] + // rewrite padId var oldPadId = key.split(":"); oldPadId[1] = padId; - var newKey = oldPadId.join(":"); // create the new key + if(oldPadId[0] === "pad"){ + var newKey = oldPadId.join(":"); // create the new key + } + + // Add the author to this new pad + if(oldPadId[0] === "globalAuthor"){ + value.padIDs[padId] = 1 ; + var newKey = value; + } // Write the value to the server db.set(newKey, value); -- cgit v1.2.3