Merge pull request #2730 from emilyxxie/clientready_hook

added clientReady hook
pull/2805/head
Stefan 2015-10-10 13:30:36 +02:00
commit 9d29b15def
2 changed files with 19 additions and 0 deletions

View File

@ -384,3 +384,20 @@ exports.userLeave = function(hook, session, callback) {
console.log('%s left pad %s', session.author, session.padId); console.log('%s left pad %s', session.author, session.padId);
}; };
``` ```
### clientReady
Called from src/node/handler/PadMessageHandler.js
This in context:
1. message
This hook gets called when handling a CLIENT_READY which is the first message from the client to the server.
Example:
```
exports.clientReady = function(hook, message) {
console.log('Client has entered the pad' + message.padId);
};
```

View File

@ -1020,6 +1020,8 @@ function handleClientReady(client, message)
var currentTime; var currentTime;
var padIds; var padIds;
hooks.callAll("clientReady", message);
async.series([ async.series([
//Get ro/rw id:s //Get ro/rw id:s
function (callback) function (callback)