Skip to content

Commit

Permalink
namespace: make in able to track multiple rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 24, 2012
1 parent 59c8c34 commit 5d4f90d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,17 @@ Namespace.prototype.run = function(socket, fn){
};

/**
* Targets a room.
* Targets a room when emitting.
*
* @api private
* @param {String} name
* @return {Namespace} self
* @api public
*/

Namespace.prototype.to =
Namespace.prototype.in = function(fn){
this.rooms.push(fn);
Namespace.prototype.in = function(name){
this.rooms = this.rooms || [];
if (!~this.rooms.indexOf(name)) this.rooms.push(name);
return this;
};

Expand Down

0 comments on commit 5d4f90d

Please sign in to comment.