summaryrefslogtreecommitdiffstats
path: root/webchat/index.js
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-11 18:58:09 +0100
committerlassulus <lassulus@googlemail.com>2013-11-11 18:58:09 +0100
commit9c808dbac3eb24f57e14f828761529fc668e7577 (patch)
treedda6187cd5eedd94d1b4d4d79d94d5ea3abfebc2 /webchat/index.js
parent2be3c286f5151ca319700dd4bd7c6d16cec6c2c4 (diff)
webchat: serverCommands fixed
Diffstat (limited to 'webchat/index.js')
-rw-r--r--webchat/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/webchat/index.js b/webchat/index.js
index 14794e72..0ec448c4 100644
--- a/webchat/index.js
+++ b/webchat/index.js
@@ -24,7 +24,7 @@ clients.notifyAll = function (method, params) {
});
}
-
+serverstate.clients = clients;
var irc_reconnect = function() { //reconnt to irc
console.log("reconnecting due to pingtimeout");
@@ -50,7 +50,7 @@ var irc_client = new irc.Client('irc.freenode.net', 'kweb', { //create irc_clien
autoConnect: true,
stripColors: true
});
-
+serverstate.irc_client = irc_client;
irc_client.on('ping', function(server) { //restart timer on server ping
console.log("got ping from server, renewing timeout for automatic reconnect");
@@ -114,7 +114,7 @@ echo.on('connection', function(conn) {
if (!command || typeof command !== 'object') {
command = {}
}
- return (serverCommands[command.method] || serverCommands.badcommand)(settings, command.params)
+ return (serverCommands[command.method] || serverCommands.badcommand)(serverstate, settings, command.params)
});
conn.on('close', function() { //propagate if client quits the page
clients.splice(clients.indexOf(conn));