mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
more author logic
This commit is contained in:
parent
ec2b844f94
commit
1e0de620be
1 changed files with 10 additions and 1 deletions
|
@ -23,10 +23,19 @@ exports.setPadRaw = function(padId, records, callback){
|
||||||
|
|
||||||
async.eachSeries(Object.keys(records), function(key, cb){
|
async.eachSeries(Object.keys(records), function(key, cb){
|
||||||
var value = records[key]
|
var value = records[key]
|
||||||
|
|
||||||
// rewrite padId
|
// rewrite padId
|
||||||
var oldPadId = key.split(":");
|
var oldPadId = key.split(":");
|
||||||
oldPadId[1] = padId;
|
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
|
// Write the value to the server
|
||||||
db.set(newKey, value);
|
db.set(newKey, value);
|
||||||
|
|
Loading…
Reference in a new issue