-/* $Id: config.js,v 1.1 2006/11/27 13:57:27 mmondor Exp $ */
+/* $Id: config.js,v 1.2 2006/11/27 14:30:28 mmondor Exp $ */
/* Configuration */
var irc_channel = '#gurumeditation';
var irc_quit_message = 'Farewell';
var irc_auto_whois = true;
var irc_log_pings = false;
+var irc_auto_voice = [];
+var irc_auto_op = [
+ "^mur![^@]*@smtp.uiah.fi$",
+ "^phadthai![^@]*@ginseng.pulsar-zone.net$",
+ "^cprior![^@]*@unaffiliated/cprior$",
+ "^Kool-Aid![^@]*@[^.]*.[^.]*.or.comcast.net$"
+];
+var irc_auto_ban = [];
/* XXX Would be more complex, but ideal
var networks = [
-/* $Id: irclog.js,v 1.9 2006/11/27 14:03:01 mmondor Exp $ */
+/* $Id: irclog.js,v 1.10 2006/11/27 14:30:28 mmondor Exp $ */
-var irc_version = '$Id: irclog.js,v 1.9 2006/11/27 14:03:01 mmondor Exp $';
+var irc_version = '$Id: irclog.js,v 1.10 2006/11/27 14:30:28 mmondor Exp $';
function file_read(name)
{
File.prototype.state_log = function()
{
- var line, s, from, to, chan, msg, w;
+ var line, s, from, to, chan, msg, w, i;
stdout.write(log_timestamp() + ' -+- Entering state_log()' + "\n");
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;
- continue;
- } else if (irc_auto_whois) {
- this.putline('WHOIS ' + from);
- continue;
+ else {
+ if (irc_auto_whois)
+ this.putline('WHOIS ' + from);
+ /* Check for auto op/voice/ban */
+ w = line.split(' ');
+ s = w[0].substr(1);
+ for (i in irc_auto_voice) {
+ if (s.match(irc_auto_voice[i])
+ != null) {
+ this.putline('MODE ' +
+ irc_channel + ' +v ' +
+ from);
+ break;
+ }
+ }
+ for (i in irc_auto_op) {
+ if (s.match(irc_auto_op[i])
+ != null) {
+ this.putline('MODE ' +
+ irc_channel + ' +o ' +
+ from);
+ break;
+ }
+ }
+ for (i in irc_auto_ban) {
+ if (s.match(irc_auto_ban[i].regex)
+ != null) {
+ this.putline('MODE ' +
+ irc_channel + ' +b ' +
+ irc_auto_ban[i].mask);
+ this.putline('KICK ' +
+ irc_channel + ' ' +
+ from + ' :automatic ban');
+ break;
+ }
+ }
}
+ continue;
}
/* :<nick>!<user>@<host> KICK <channel> <nick> :<message> */