summaryrefslogtreecommitdiffstats
path: root/webchat
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-11 18:31:04 +0100
committerlassulus <lassulus@googlemail.com>2013-11-11 18:31:04 +0100
commit2be3c286f5151ca319700dd4bd7c6d16cec6c2c4 (patch)
treea37cf8a8214b50dfab5174b58a1acdb97a4a5065 /webchat
parent27f21424befaf1d10877d53d9754c88b43f42903 (diff)
webchat: cleanup code
Diffstat (limited to 'webchat')
-rw-r--r--webchat/index.js5
-rw-r--r--webchat/public/functions.js12
-rw-r--r--webchat/serverCommands.js3
3 files changed, 0 insertions, 20 deletions
diff --git a/webchat/index.js b/webchat/index.js
index 66fd43b5..14794e72 100644
--- a/webchat/index.js
+++ b/webchat/index.js
@@ -61,19 +61,16 @@ irc_client.on('ping', function(server) { //restart timer on server ping
irc_client.on('message#krebs', function(from, message) {
console.log({ from: from, message: message });
clients.notifyAll('message', { nick: from, msg: message });
-// clients.broadcast({ method: 'message', params: {nick: from, msg: message} }); //broadcast irc messages to all connected clients
clearTimeout(lastping);
});
irc_client.on('names#krebs', function(nicks) {
-// clients.broadcast({method: 'nicklist', params: { nicklist: nicks }});
clients.notifyAll('nicklist', { nicklist: nicks })
});
irc_client.on('join#krebs', function(nick, msg) {
if (nick !== 'kweb'){
clients.notifyAll('join', { from: nick })
-// clients.broadcast({method: 'join', params: { from: nick }});
}
});
@@ -101,7 +98,6 @@ echo.on('connection', function(conn) {
}
clients.push(settings);
clients.notifyAll('join', { from: settings.nick })
-// clients.broadcast({method: 'join', params: { from: settings.nick }})
// irc_client.say("#krebs", origin + ' has joined');
if (typeof irc_client.chans['#krebs'] === 'object') {
conn.write(JSON.stringify({method: 'nicklist', params: { nicklist: irc_client.chans['#krebs'].users }})); //send current nicklist
@@ -123,7 +119,6 @@ echo.on('connection', function(conn) {
conn.on('close', function() { //propagate if client quits the page
clients.splice(clients.indexOf(conn));
clients.notifyAll('quit', { from: settings.nick })
-// clients.broadcast({method: 'quit', params: { from: origin }})
// irc_client.say("#krebs", origin + ' has quit');
});
});
diff --git a/webchat/public/functions.js b/webchat/public/functions.js
index 0b8f2d49..b669a928 100644
--- a/webchat/public/functions.js
+++ b/webchat/public/functions.js
@@ -11,18 +11,6 @@ function inputParser (str) {
function clientParser(object) {
console.log('parser: ',object)
return (handler[object.method] || console.log)(object.params)
-//switch (object.method) {
-// case 'message':
-// return handler.message(object.params);
-// case 'join':
-// return handler.join(object.params);
-// case 'quit':
-// return handler.quit(object.params);
-// case 'nicklist':
-// return handler.nicklist(object.params);
-// case 'nickchange':
-// return handler.nickchange(object.params);
-//}
};
diff --git a/webchat/serverCommands.js b/webchat/serverCommands.js
index 8f2875b9..0443bc91 100644
--- a/webchat/serverCommands.js
+++ b/webchat/serverCommands.js
@@ -7,8 +7,6 @@ serverCommands.say = function (settings, params) {
params.nick = nick
irc_client.say("#krebs", nick + ' → ' + message);
return clients.notifyAll('message', params)
-// return clients.broadcast({ method: 'message', params: params })
-
}
serverCommands.nick = function (settings, params) {
@@ -16,7 +14,6 @@ serverCommands.nick = function (settings, params) {
var newnick = params.nick
settings.nick = newnick
return clients.notifyAll('nickchange', { nick: oldnick, newnick: newnick });
-// return clients.broadcast({ method: 'nickchange', params: { nick: oldnick, newnick: newnick }})
}
serverCommands.badcommand = function (settings, params) {