diff options
author | John McLear <john@mclear.co.uk> | 2014-12-29 23:08:17 +0100 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-12-29 23:08:17 +0100 |
commit | 1e0de620be85b7b4d8af1472a52a851933a921d0 (patch) | |
tree | f5a24195fa32042e8c46084f38ce711d8d3582e6 /src/node | |
parent | ec2b844f9433b61c570fd0624644f19de43e4208 (diff) | |
download | etherpad-lite-1e0de620be85b7b4d8af1472a52a851933a921d0.zip |
more author logic
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/utils/ImportEtherpad.js | 11 |
1 files changed, 10 insertions, 1 deletions
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); |