Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Adapter.prototype.del = function(id, room, fn){
* @api public
*/

Adapter.prototype.delAll = function(id, fn){
Adapter.prototype.delAll = function(id){
var rooms = this.sids[id];
if (rooms) {
for (var room in rooms) {
Expand All @@ -94,6 +94,20 @@ Adapter.prototype.delAll = function(id, fn){
delete this.sids[id];
};

/**
* Lists the id of each socket in a room.
*
* @param {String} room name
* @param {Function} callback
* @api public
*/

Adapter.prototype.list = function(room, fn){
var r = Object.keys(this.rooms[room] || {});

if (fn) process.nextTick(fn.bind(null, null, r));
};

/**
* Broadcasts a packet.
*
Expand Down