From c7124aa49e7e48a8940364dd70ae8aa2e91a04c2 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 27 Mar 2012 15:05:56 +0100 Subject: [PATCH] Revert "Vaguely functional now. Will work on more later." This reverts commit 055ec147195399a4a918341ee1767579670eeeaf. --- modules/logging.js | 18 ++++-------------- modules/web.js | 7 +------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/modules/logging.js b/modules/logging.js index 34f8394..2adea53 100644 --- a/modules/logging.js +++ b/modules/logging.js @@ -1,19 +1,9 @@ var logging = function(dbot) { - var logMessage = function(message, channel) { + var logMessage = function(message) { if(!(dbot.hasOwnProperty('log'))) { - dbot['log'] = {}; + dbot['log'] = []; } - - if(channel) { - channel = channel.toLowerCase(); - } else { - channel = '@'; // it's a logger message, shouldn't go in any channel. hence, invalid channel name '@' - } - - if(!(dbot.log.hasOwnProperty(channel))) { - dbot.log[channel] = []; - } - dbot.log[channel].push([Date.now(), message]); + dbot.log.push([Date.now(), message]); }; return { @@ -40,7 +30,7 @@ var logging = function(dbot) { 'eventType': eventType, 'data': data } - }, data.channel); + }); }, 'on': ['JOIN', 'PART', 'KICK', 'PRIVMSG', 'MODE'] }; diff --git a/modules/web.js b/modules/web.js index 639eba2..a6bd581 100644 --- a/modules/web.js +++ b/modules/web.js @@ -18,12 +18,7 @@ var webInterface = function(dbot) { // Displays any logs collected by the logging module app.get('/log', function(req, res) { - res.redirect('/log/identicurse'); - }); - - app.get('/log/:channel', function(req, res) { - var channel = '#' + req.params.channel.toLowerCase(); - res.render('log', { 'name': dbot.name, 'log': (dbot.log[channel] || []), 'channel': channel }); + res.render('log', { 'name': dbot.name, 'log': (dbot.log || []) }); }); // Lists the quote categories