fixed and unified indenting, added comments in handleClientReady

This commit is contained in:
mluto 2013-01-06 14:55:33 +01:00
parent 6e7b694243
commit 9484b92ae2
1 changed files with 11 additions and 10 deletions

View File

@ -782,15 +782,15 @@ function handleClientReady(client, message)
var padIds; var padIds;
async.series([ async.series([
// Get ro/rw id:s //Get ro/rw id:s
function (callback) { function (callback)
{
readOnlyManager.getIds(message.padId, function(err, value) { readOnlyManager.getIds(message.padId, function(err, value) {
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
padIds = value; padIds = value;
callback(); callback();
}); });
}, },
//check permissions //check permissions
function(callback) function(callback)
{ {
@ -816,7 +816,7 @@ function handleClientReady(client, message)
} }
}); });
}, },
//get all authordata of this new user //get all authordata of this new user, and load the pad-object from the database
function(callback) function(callback)
{ {
async.parallel([ async.parallel([
@ -840,6 +840,7 @@ function handleClientReady(client, message)
callback(); callback();
}); });
}, },
//get pad
function(callback) function(callback)
{ {
padManager.getPad(padIds.padId, function(err, value) padManager.getPad(padIds.padId, function(err, value)
@ -851,7 +852,7 @@ function handleClientReady(client, message)
} }
], callback); ], callback);
}, },
//these db requests all need the pad object //these db requests all need the pad object (timestamp of latest revission, author data, chat messages)
function(callback) function(callback)
{ {
var authors = pad.getAllAuthors(); var authors = pad.getAllAuthors();
@ -894,6 +895,7 @@ function handleClientReady(client, message)
], callback); ], callback);
}, },
//glue the clientVars together, send them and tell the other clients that a new one is there
function(callback) function(callback)
{ {
//Check that the client is still here. It might have disconnected between callbacks. //Check that the client is still here. It might have disconnected between callbacks.
@ -980,11 +982,10 @@ function handleClientReady(client, message)
}, },
"abiwordAvailable": settings.abiwordAvailable(), "abiwordAvailable": settings.abiwordAvailable(),
"plugins": { "plugins": {
"plugins": plugins.plugins, "plugins": plugins.plugins,
"parts": plugins.parts, "parts": plugins.parts,
}, },
"initialChangesets": [] // FIXME: REMOVE THIS SHIT "initialChangesets": [] // FIXME: REMOVE THIS SHIT
} }
//Add a username to the clientVars if one avaiable //Add a username to the clientVars if one avaiable