sub queueTask {
my($codename, $chanconfdef, $intervaldef, $defer) = @_;
- my $t = &getChanConfDefault($chanconfdef, $intervaldef);
+ my $t = &getChanConfDefault($chanconfdef, $intervaldef, $chan);
my $waittime = &getRandomInt($t);
if (!defined $waittime) {
####
sub randomQuote {
- my $interval = &getChanConfDefault("randomQuoteInterval", 60);
+ my $interval = &getChanConfDefault("randomQuoteInterval", 60, $chan);
if (@_) {
&ScheduleThis($interval, "randomQuote");
return if ($_[0] eq "2"); # defer.
my ($key,$val);
my $error = 0;
- my $interval = &getChanConfDefault("randomFactoidInterval", 60);
+ my $interval = &getChanConfDefault("randomFactoidInterval", 60, $chan);
if (@_) {
&ScheduleThis($interval, "randomFactoid");
return if ($_[0] eq "2"); # defer.
($key,$val) = &randKey("factoids","factoid_key,factoid_value");
&DEBUG("rF: $key, $val");
### $val =~ tr/^[A-Z]/[a-z]/; # blah is Good => blah is good.
- last if ((defined $val) and ($val !~ /^</) and ($key !~ /\#DEL\#/) and ($key !~ /^CMD:/));
+ last if ((defined $val) and ($val !~ /^</) and ($key !~ /\#DEL\#/) and ($key !~ /^cmd:/));
$error++;
if ($error == 5) {
return unless (&IsChanConf("seenFlushInterval") > 0);
# global setting. does not make sense for per-channel.
- my $max_time = &getChanConfDefault("seenMaxDays", 30) *60*60*24;
+ my $max_time = &getChanConfDefault("seenMaxDays", 30, $chan) *60*60*24;
my $delete = 0;
- if ($param{'DBType'} =~ /^(pgsql|mysql|sqlite)/i) {
+ if ($param{'DBType'} =~ /^(pgsql|mysql|sqlite(2)?)$/i) {
my $query;
- if ($param{'DBType'} =~ /^mysql|sqlite$/i) {
+ if ($param{'DBType'} =~ /^(mysql|sqlite(2)?)$/i) {
$query = "SELECT nick,time FROM seen GROUP BY nick HAVING ".
"UNIX_TIMESTAMP() - time > $max_time";
} else { # pgsql.
return if ($_[0] eq "2"); # defer.
}
- if (!&ChanConfList("news")) {
+ if (!&ChanConfList('News')) {
&DEBUG("newsFlush: news disabled? (chan => $chan)");
return;
}
}
sub chanlimitCheck {
- my $interval = &getChanConfDefault("chanlimitcheckInterval", 10);
+ my $interval = &getChanConfDefault("chanlimitcheckInterval", 10, $chan);
my $mynick=$conn->nick();
if (@_) {
}
my $time = time();
- my $interval = &getChanConfDefault("floodCycle",60);
+ my $interval = &getChanConfDefault("floodCycle",60, $chan);
foreach $who (keys %flood) {
foreach (keys %{ $flood{$who} }) {
sub seenFlush {
if (@_) {
- my $interval = &getChanConfDefault("seenFlushInterval", 60);
+ my $interval = &getChanConfDefault("seenFlushInterval", 60, $chan);
&ScheduleThis($interval, "seenFlush");
return if ($_[0] eq "2");
}
my %stats;
my $nick;
- my $flushed = 0;
+ my $flushed = 0;
$stats{'count_old'} = &countKeys("seen") || 0;
$stats{'new'} = 0;
$stats{'old'} = 0;
- if ($param{'DBType'} =~ /^(mysql|pgsql|sqlite)$/i) {
+ if ($param{'DBType'} =~ /^(mysql|pgsql|sqlite(2)?)$/i) {
foreach $nick (keys %seencache) {
my $retval = &sqlReplace("seen", {
nick => lc $seencache{$nick}{'nick'},
sub uptimeLoop {
return if (!defined &uptimeWriteFile);
-# return unless &IsChanConf('Uptime');
+# return unless &IsParam('Uptime');
if (@_) {
&ScheduleThis(60, 'uptimeLoop');
my @chans = &ChanConfList("kernelAnnounce");
return unless (scalar @chans);
- &Forker("kernel", sub {
+ &Forker("Kernel", sub {
my @data = &Kernel::kernelAnnounce();
foreach (@chans) {
}
sub wingateCheck {
- return unless &IsChanConf('Wingate');
+ return unless &IsChanConf('Wingate') > 0;
### FILE CACHE OF OFFENDING WINGATES.
foreach (grep /^$host$/, @wingateBad) {
&status("Wingate: RUNNING ON $host BY $who");
- &ban("*!*\@$host", "") if &IsChanConf('wingateBan');
+ &ban("*!*\@$host", "") if &IsChanConf('wingateBan') > 0;
my $reason = &getChanConf('wingateKick');
&DEBUG("Already scanned $host. good.");
}
- my $interval = &getChanConfDefault('wingateInterval', 60); # seconds.
+ my $interval = &getChanConfDefault('wingateInterval', 60, $chan); # seconds.
return if (defined $forked{'Wingate'});
return if (time() - $wingaterun <= $interval);
return unless (scalar(keys %wingateToDo));
}
my @list = &searchTable("factoids", "factoid_key", "factoid_key", " #DEL#");
- my $stale = &getChanConfDefault("factoidDeleteDelay", 14) *60*60*24;
+ my $stale = &getChanConfDefault("factoidDeleteDelay", 14, $chan) *60*60*24;
if ($stale < 1) {
# disable it since it's "illegal".
return;