From 43b0f03fd26b8367c3be52333f42767b4b518fb4 Mon Sep 17 00:00:00 2001 From: Ali Asaria Date: Sat, 24 Sep 2011 13:09:03 -0400 Subject: [PATCH] room announcement update to support socket 0.7 --- lib/rooms.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rooms.js b/lib/rooms.js index 8f67f1b..be2bb0d 100644 --- a/lib/rooms.js +++ b/lib/rooms.js @@ -144,7 +144,7 @@ exports.add_to_room_and_announce = function (client, room, msg) { for (var i = 0; i < clients.length; i++) { if (clients[i].id != client.id) - clients[i].send(msg); + clients[i].json.send(msg); } }); } @@ -171,7 +171,7 @@ exports.remove_from_all_rooms_and_announce = function (client, msg) { for (var i = 0; i < clients.length; i++) { if (clients[i].id != client.id) - clients[i].send(msg); + clients[i].json.send(msg); } }); } @@ -192,7 +192,7 @@ exports.broadcast = function(msg) { exports.broadcast_room = function(room, msg) { var clients = exports.room_clients(room); for (var i = 0; i < clients.length; i++) - clients[i].send(msg); + clients[i].json.send(msg); }; // Broadcast message to all the other clients that are in rooms with this client @@ -224,6 +224,6 @@ exports.broadcast_to_roommates = function (client, msg) { for (var i = 0; i < roommates.length; i++) { console.log(' - ' + roommates[i].id); - roommates[i].send(msg); + roommates[i].json.send(msg); } }