Permalink
Browse files

room announcement update to support socket 0.7

  • Loading branch information...
Ali Asaria Ali Asaria
Ali Asaria authored and Ali Asaria committed Sep 24, 2011
1 parent 0e164fc commit 43b0f03fd26b8367c3be52333f42767b4b518fb4
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rooms.js
View
@@ -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);
}
}

0 comments on commit 43b0f03

Please sign in to comment.