Skip to content

Commit

Permalink
more lax on mock connections for socketRoomBroadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Oct 17, 2012
1 parent a649238 commit b4445af
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions initializers/initChatRooms.js
Expand Up @@ -26,12 +26,11 @@ var initChatRooms = function(api, next){
api.redis.client.publish(api.chatRoom.chatChannel, JSON.stringify(payload));
}
else{
if(connection == null){
connection = {room: api.configData.general.defaultChatRoom, public: {id: 0}}
var messagePayload = {message: message, from: api.configData.general.serverName, context: "user"};
}else{
var messagePayload = {message: message, from: connection.public.id, context: "user"};
}
if(connection == null){ connection = {}; }
if(connection.room == null){ connection.room = api.configData.general.defaultChatRoom; }
if(connection.public == null){ connection.public = {}; }
if(connection.public.id == null){ connection.public.id = 0; }
var messagePayload = {message: message, from: connection.public.id, context: "user"};
// TCP clients
if(api.socketServer != null){
for(var i in api.socketServer.connections){
Expand Down

0 comments on commit b4445af

Please sign in to comment.