socket.io-adapter
Advanced tools
Comparing version 0.3.0 to 0.3.1
0.3.1 / 2014-10-27 | ||
================== | ||
* bump parser version | ||
* fix room autopruning | ||
* add autoprunning of empty rooms | ||
* rooms are now created as objects | ||
* added the repository field. | ||
* updated the debug dependency. | ||
0.3.0 / 2014-05-30 | ||
@@ -3,0 +13,0 @@ ================== |
35
index.js
@@ -6,2 +6,3 @@ | ||
var keys = require('object-keys'); | ||
var Emitter = require('events').EventEmitter; | ||
@@ -48,3 +49,3 @@ var parser = require('socket.io-parser'); | ||
this.sids[id][room] = true; | ||
this.rooms[room] = this.rooms[room] || []; | ||
this.rooms[room] = this.rooms[room] || {}; | ||
this.rooms[room][id] = true; | ||
@@ -68,2 +69,6 @@ if (fn) process.nextTick(fn.bind(null, null)); | ||
delete this.rooms[room][id]; | ||
if (this.rooms.hasOwnProperty(room) && !keys(this.rooms[room]).length) { | ||
delete this.rooms[room]; | ||
} | ||
if (fn) process.nextTick(fn.bind(null, null)); | ||
@@ -83,3 +88,9 @@ }; | ||
for (var room in rooms) { | ||
delete this.rooms[room][id]; | ||
if (rooms.hasOwnProperty(room)) { | ||
delete this.rooms[room][id]; | ||
} | ||
if (this.rooms.hasOwnProperty(room) && !keys(this.rooms[room]).length) { | ||
delete this.rooms[room]; | ||
} | ||
} | ||
@@ -117,7 +128,9 @@ } | ||
for (var id in room) { | ||
if (ids[id] || ~except.indexOf(id)) continue; | ||
socket = self.nsp.connected[id]; | ||
if (socket) { | ||
socket.packet(encodedPackets, true, flags.volatile); | ||
ids[id] = true; | ||
if (room.hasOwnProperty(id)) { | ||
if (ids[id] || ~except.indexOf(id)) continue; | ||
socket = self.nsp.connected[id]; | ||
if (socket) { | ||
socket.packet(encodedPackets, true, flags.volatile); | ||
ids[id] = true; | ||
} | ||
} | ||
@@ -128,5 +141,7 @@ } | ||
for (var id in self.sids) { | ||
if (~except.indexOf(id)) continue; | ||
socket = self.nsp.connected[id]; | ||
if (socket) socket.packet(encodedPackets, true, flags.volatile); | ||
if (self.sids.hasOwnProperty(id)) { | ||
if (~except.indexOf(id)) continue; | ||
socket = self.nsp.connected[id]; | ||
if (socket) socket.packet(encodedPackets, true, flags.volatile); | ||
} | ||
} | ||
@@ -133,0 +148,0 @@ } |
{ | ||
"name": "socket.io-adapter", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/Automattic/socket.io-adapter.git" | ||
}, | ||
"description": "", | ||
"dependencies": { | ||
"debug": "0.7.4", | ||
"socket.io-parser": "2.2.0" | ||
"debug": "1.0.2", | ||
"socket.io-parser": "2.2.2", | ||
"object-keys": "1.0.1" | ||
} | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4295
125
0
3
+ Addedobject-keys@1.0.1
+ Addedbenchmark@1.0.0(transitive)
+ Addedcomponent-emitter@1.1.2(transitive)
+ Addeddebug@1.0.2(transitive)
+ Addedms@0.6.2(transitive)
+ Addedobject-keys@1.0.1(transitive)
+ Addedsocket.io-parser@2.2.2(transitive)
- Removedsocket.io-parser@2.2.0(transitive)
Updateddebug@1.0.2
Updatedsocket.io-parser@2.2.2