Merge pull request #10 from rase-/patch-1

Add autoprunning of empty rooms - rebased
This commit is contained in:
Tony Kovanen
2014-09-11 16:52:38 +03:00

View File

@@ -63,6 +63,10 @@ Adapter.prototype.del = function(id, room, fn){
this.rooms[room] = this.rooms[room] || {};
delete this.sids[id][room];
delete this.rooms[room][id];
if (!this.rooms[room].length) {
delete this.rooms[room];
}
if (fn) process.nextTick(fn.bind(null, null));
};
@@ -80,6 +84,10 @@ Adapter.prototype.delAll = function(id, fn){
if (rooms.hasOwnProperty(room)) {
delete this.rooms[room][id];
}
if (!this.rooms[room].length) {
delete this.rooms[room];
}
}
}
delete this.sids[id];