-/* $Id: irclog.js,v 1.15 2007/01/03 07:21:32 mmondor Exp $ */
+/* $Id: irclog.js,v 1.16 2007/01/04 05:29:38 mmondor Exp $ */
/*
* XXX TODO XXX
- * - Fix month which currently stats at 0 rather than 1
* - Use an FD instead of a File so that we may also implement timeouts.
* This is because despite TCP_KEEP_ALIVE the connection can occasionally
* remain locked for a long time with inactivity. The client should
* reconnect to a server once it reaches a configurable input timeout.
- * - Perform a topic check on channel joining, rather than only names.
* - Write a timer class to avoid having to use popen() with /bin/sleep!
*/
-var irc_version = '$Id: irclog.js,v 1.15 2007/01/03 07:21:32 mmondor Exp $';
+var irc_version = '$Id: irclog.js,v 1.16 2007/01/04 05:29:38 mmondor Exp $';
function file_read(name)
{
function log_timestamp()
{
var t = new Date();
- var s = t.getUTCFullYear() + log_digits[t.getUTCMonth()] +
+ var s = t.getUTCFullYear() + log_digits[t.getUTCMonth() + 1] +
log_digits[t.getUTCDate()] + log_digits[t.getUTCHours()] +
log_digits[t.getUTCMinutes()] + log_digits[t.getUTCSeconds()] +
'-0000';
msg = line.substr(s.length);
from = line.substr(1, line.indexOf('!') - 1);
if (from.toLowerCase() == irc_nickname.toLowerCase() &&
- msg.toLowerCase() == irc_channel.toLowerCase())
+ msg.toLowerCase() == irc_channel.toLowerCase()) {
on_channel = true;
- else {
+ this.putline('TOPIC ' + irc_channel);
+ } else {
if (irc_auto_whois)
this.putline('WHOIS ' + from);
/* Check for auto op/voice/ban */