Skip to content

Commit

Permalink
Pusher.trigger - make socketId optional
Browse files Browse the repository at this point in the history
  • Loading branch information
alram committed Apr 28, 2012
1 parent 0b925a4 commit 6ed8c54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/node-pusher.js
Expand Up @@ -23,6 +23,10 @@ module.exports = (function() {
}

Pusher.prototype.trigger = function(channel, event, message, socketId, callback) {
if (typeof callback === 'undefined') {
callback = socketId;
socketId = '';
}
var timestamp = parseInt(new Date().getTime() / 1000);
var requestBody = JSON.stringify(message);
var hash = crypto.createHash('md5').update(new Buffer(requestBody).toString('binary')).digest('hex');
Expand Down

0 comments on commit 6ed8c54

Please sign in to comment.