my $author = &getFactInfo($faqtoid, "created_by");
my $count = &getFactInfo($faqtoid, "requested_count") || 0;
# don't delete if requested $limit times
- my $limit = &getChanConfDefault(
- "factoidPreventForgetLimit", 100, $chan);
+ my $limit = &getChanConfDefault('factoidPreventForgetLimit', 100, $chan);
# don't delete if older than $limitage seconds (modified by requests below)
- my $limitage = &getChanConfDefault(
- "factoidPreventForgetLimitTime", 7 * 24 * 60 * 60, $chan);
+ my $limitage = &getChanConfDefault('factoidPreventForgetLimitTime', 7 * 24 * 60 * 60, $chan);
my $t = &getFactInfo($faqtoid, "created_time") || 0;
my $age = time() - $t;
$message =~ tr/A-Z/a-z/;
- @searches = split(/\s+/, &getChanConfDefault('factoidSearch', '_default'));
-
+ @searches = split(/\s+/, &getChanConfDefault('factoidSearch', '_default', $chan));
+ &::DEBUG("factoidSearch: $chan is: " . join(':', @searches));
# requesting the _default one, ignore factoidSearch
if ($message =~ /^_default\s+/) {
@searches = ('_default');
$pubcount++;
$pubsize += length $msg;
- my $i = &getChanConfDefault("sendPublicLimitLines", 3);
- my $j = &getChanConfDefault("sendPublicLimitBytes", 1000);
+ my $i = &getChanConfDefault("sendPublicLimitLines", 3, $chan);
+ my $j = &getChanConfDefault("sendPublicLimitBytes", 1000, $chan);
if ( ($pubcount % $i) == 0 and $pubcount) {
sleep 1;
$msgcount++;
$msgsize += length $msg;
- my $i = &getChanConfDefault("sendPrivateLimitLines", 3);
- my $j = &getChanConfDefault("sendPrivateLimitBytes", 1000);
+ my $i = &getChanConfDefault("sendPrivateLimitLines", 3, $chan);
+ my $j = &getChanConfDefault("sendPrivateLimitBytes", 1000, $chan);
if ( ($msgcount % $i) == 0 and $msgcount) {
sleep 1;
} elsif ($msgsize > $j) {
$notcount++;
$notsize += length $txt;
- my $i = &getChanConfDefault("sendNoticeLimitLines", 3);
- my $j = &getChanConfDefault("sendNoticeLimitBytes", 1000);
+ my $i = &getChanConfDefault("sendNoticeLimitLines", 3, $chan);
+ my $j = &getChanConfDefault("sendNoticeLimitBytes", 1000, $chan);
if ( ($notcount % $i) == 0 and $notcount) {
sleep 1;
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.
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) {
}
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");
}
&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;
sub formListReply {
my($rand, $prefix, @list) = @_;
my $total = scalar @list;
- my $maxshow = &getChanConfDefault('maxListReplyCount', 15);
- my $maxlen = &getChanConfDefault('maxListReplyLength', 400);
+ my $maxshow = &getChanConfDefault('maxListReplyCount', 15, $chan);
+ my $maxlen = &getChanConfDefault('maxListReplyLength', 400, $chan);
my $reply;
# remove irc overhead
my $announce = 0;
my $defaultdist = 'sid';
-my $refresh = &::getChanConfDefault('debianRefreshInterval',7)
- * 60 * 60 * 24;
+my $refresh = &::getChanConfDefault('debianRefreshInterval', 7, $chan) * 60 * 60 * 24;
my $debug = 0;
my $debian_dir = $::bot_state_dir . 'debian';
my $country = 'us'; # well .config it yourself then. ;-)
sub CmdListAuth {
my ($query) = @_;
- my $maxshow = &::getChanConfDefault('maxListReplyCount', 15);
+ my $maxshow = &::getChanConfDefault('maxListReplyCount', 15, $chan);
my @list = &searchTable("factoids","factoid_key", "created_by", "^$query!");
@list=grep(!/\#DEL\#$/,@list) if (scalar(@list) > $maxshow);
}
$::news{$chan}{$str}{Time} = time();
- my $expire = &::getChanConfDefault("newsDefaultExpire",7);
+ my $expire = &::getChanConfDefault("newsDefaultExpire",7, $chan);
$::news{$chan}{$str}{Expire} = time() + $expire*60*60*24;
$::news{$chan}{$str}{Author} = $::who; # case!
my ($type, $str) = @_;
my $start_time = &::timeget();
my @list;
- my $maxshow = &::getChanConfDefault('maxListReplyCount', 15);
+ my $maxshow = &::getChanConfDefault('maxListReplyCount', 15, $chan);
$type =~ s/s$//; # nice work-around.
sub getChanConfDefault {
my($what, $default, $chan) = @_;
-
$chan ||= "_default";
if (exists $param{$what}) {
&checkTables();
&status("Setup: ". &countKeys("factoids") ." factoids.");
- &getChanConfDefault("sendPrivateLimitLines", 3);
- &getChanConfDefault("sendPrivateLimitBytes", 1000);
- &getChanConfDefault("sendPublicLimitLines", 3);
- &getChanConfDefault("sendPublicLimitBytes", 1000);
- &getChanConfDefault("sendNoticeLimitLines", 3);
- &getChanConfDefault("sendNoticeLimitBytes", 1000);
+ &getChanConfDefault("sendPrivateLimitLines", 3, $chan);
+ &getChanConfDefault("sendPrivateLimitBytes", 1000, $chan);
+ &getChanConfDefault("sendPublicLimitLines", 3, $chan);
+ &getChanConfDefault("sendPublicLimitBytes", 1000, $chan);
+ &getChanConfDefault("sendNoticeLimitLines", 3, $chan);
+ &getChanConfDefault("sendNoticeLimitBytes", 1000, $chan);
$param{tempDir} =~ s#\~/#$ENV{HOME}/#;