From 1f84e0fe6bad2358bb344e03777d135c81278705 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 2 Feb 2015 18:02:11 +0100 Subject: [PATCH] typo --- ChainPadSrv.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ChainPadSrv.js b/ChainPadSrv.js index 979e6c065..2e058819c 100644 --- a/ChainPadSrv.js +++ b/ChainPadSrv.js @@ -68,7 +68,7 @@ var sendChannelMessage = function (ctx, channel, msg, cb) { sendMsg(msg, user.socket); } catch (e) { console.log(e.stack); - try { dropClient(ctx, user.userPass); } catch (e) { } + try { user.socket.close(); } catch (e) { } } }); cb && cb(); @@ -130,7 +130,6 @@ console.log("[" + userPass + "] registered"); }; if (user.socket && user.socket !== socket) { user.socket.close(); } user.socket = socket; - user.userPass = userPass; var chan = ctx.channels[parsed.channelId] = ctx.channels[parsed.channelId] || []; var newChan = (chan.length === 0); @@ -142,7 +141,7 @@ console.log("[" + userPass + "] registered"); var sendMsgs = function () { sendChannelMessage(ctx, chan, msg, function () { - chan.push(client); + chan.push(user); ctx.store.getMessages(chan.name, function (msg) { try { sendMsg(msg, socket);