summaryrefslogtreecommitdiffstats
path: root/webchat
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-11 19:08:10 +0100
committerlassulus <lassulus@googlemail.com>2013-11-11 19:08:10 +0100
commit52ee854fa72607eb00229f5c251393ac392fd4f8 (patch)
treeb5ecb20d1671a413e45edafe7b637ab57a8fb059 /webchat
parent9c808dbac3eb24f57e14f828761529fc668e7577 (diff)
webchat: connected & irc_nicklist to serverstate
Diffstat (limited to 'webchat')
-rw-r--r--webchat/index.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/webchat/index.js b/webchat/index.js
index 0ec448c4..d9d7ea87 100644
--- a/webchat/index.js
+++ b/webchat/index.js
@@ -27,9 +27,11 @@ clients.notifyAll = function (method, params) {
serverstate.clients = clients;
var irc_reconnect = function() { //reconnt to irc
- console.log("reconnecting due to pingtimeout");
- irc_client.disconnect();
- irc_client.connect();
+ serverstate.connected = false
+ console.log("reconnecting due to pingtimeout")
+ irc_client.disconnect()
+ irc_client.connect()
+ serverstate.connected = true
}
var pingTimeoutDelay = 3*60*1000
@@ -66,6 +68,8 @@ irc_client.on('message#krebs', function(from, message) {
irc_client.on('names#krebs', function(nicks) {
clients.notifyAll('nicklist', { nicklist: nicks })
+ serverstate.connected = true
+ serverstate.irc_nicklist = nicks
});
irc_client.on('join#krebs', function(nick, msg) {