my $time = scalar(gmtime);
- print OUT "#v1: \$" . "Id: blootbot -- $ident -- written $time \$\n\n";
+ print OUT "#v1: blootbot -- $ident -- written $time\n\n";
### USER LIST.
my $cusers = 0;
$wtime_userfile = time();
&status("--- Saved USERFILE ($cusers users; $cbans bans; $cignore ignore) at $time");
if (defined $msgType and $msgType =~ /^chat$/) {
- &pSReply("--- Writing user file...");
+ &performStrictReply("--- Writing user file...");
}
}
$chanconf{$chan}{$1} = 1;
} elsif (/^[\s\t]+\-(\S+)$/) { # bool, false.
- &DEBUG("deprecated support of negative options.") unless ($cache{negative});
# although this is supported in run-time configuration.
- $cache{negative} = 1;
-# $chanconf{$chan}{$1} = 0;
+ $chanconf{$chan}{$1} = 0;
- } elsif (/^[\s\t]+(\S+)[\ss\t]+(.*)$/) {# what = val.
+ } elsif (/^[\s\t]+(\S+)[\s\t]+(.*)$/) {# what = val.
$chanconf{$chan}{$1} = $2;
} else {
}
}
- delete $cache{negative};
-
&status("CHANFILE: Loaded: ".(scalar(keys %chanconf)-1)." chans");
}
}
my $time = scalar(gmtime);
- print OUT "#v1: \$" . "Id: blootbot -- $ident -- written $time \$\n\n";
+ print OUT "#v1: blootbot -- $ident -- written $time\n\n";
if ($flag_quit) {
" chans) at $time");
if (defined $msgType and $msgType =~ /^chat$/) {
- &pSReply("--- Writing chan file...");
+ &performStrictReply("--- Writing chan file...");
}
}
return 1;
} else {
&status("DCC CHAT: <$who> $message -- not enough flags.");
- &pSReply("error: you do not have enough flags for that. ($flag required)");
+ &performStrictReply("error: you do not have enough flags for that. ($flag required)");
return 0;
}
}
if ($cmd eq "+chan") {
if (exists $chanconf{$chan}) {
- &pSReply("chan $chan already exists.");
+ &performStrictReply("chan $chan already exists.");
return;
}
$chanconf{$chan}{_time_added} = time();
$chanconf{$chan}{autojoin} = $conn->nick();
- &pSReply("Joining $chan...");
+ &performStrictReply("Joining $chan...");
&joinchan($chan);
return;
}
if (!exists $chanconf{$chan}) {
- &pSReply("no such channel $chan");
+ &performStrictReply("no such channel $chan");
return;
}
### ".chanset +blah"
### ".chanset +blah 10" -- error.
- my $state = ($1 eq "+") ? 1 : 0;
+ my $set = ($1 eq "+") ? 1 : 0;
my $was = $chanconf{$chan}{$what};
- if ($state) { # add/set.
+ if ($set) { # add/set.
if (defined $was and $was eq "1") {
- &pSReply("setting $what for $chan already 1.");
+ &performStrictReply("setting $what for $chan already 1.");
return;
}
} else { # delete/unset.
if (!defined $was) {
- &pSReply("setting $what for $chan is not set.");
- return;
- }
-
- if ($was eq "0") {
- &pSReply("setting $what for $chan already 0.");
+ &performStrictReply("setting $what for $chan is not set.");
return;
}
}
# alter for cosmetic (print out) reasons only.
- $was = ($was) ? "; was '$was'" : "";
+ $was = (defined $was) ? "; was '$was'" : "";
if ($val eq "0") {
- &pSReply("Unsetting $what for $chan$was.");
+ &performStrictReply("Unsetting $what for $chan$was.");
delete $chanconf{$chan}{$what};
} else {
- &pSReply("Setting $what for $chan to '$val'$was.");
+ &performStrictReply("Setting $what for $chan to '$val'$was.");
$chanconf{$chan}{$what} = $val;
}
my $was = $chanconf{$chan}{$what};
if (defined $was and $was eq $val) {
- &pSReply("setting $what for $chan already '$val'.");
+ &performStrictReply("setting $what for $chan already '$val'.");
return;
}
$was = ($was) ? "; was '$was'" : "";
- &pSReply("Setting $what for $chan to '$val'$was.");
+ &performStrictReply("Setting $what for $chan to '$val'$was.");
$chanconf{$chan}{$what} = $val;
}
if (exists $chanconf{$chan}{$what}) {
- &pSReply("$what for $chan is '$chanconf{$chan}{$what}'");
+ &performStrictReply("$what for $chan is '$chanconf{$chan}{$what}'");
} else {
- &pSReply("$what for $chan is not set.");
+ &performStrictReply("$what for $chan is not set.");
}
}
&loadMyModule('RootWarn');
delete $cache{confvars}{$_};
}
+
+ if (/^onjoin$/i and $i) {
+ &loadMyModule('OnJoin');
+ delete $cache{confvars}{$_};
+ }
}
&DEBUG("end of rehashConfVars");
delete $cache{confvars};
}
-# registered flags... not used yet.
-my @regFlagsChan = (
- "autojoin",
- "limitcheckInterval",
- "limitcheckPlus",
- "allowConv",
- "allowDNS",
-### TODO: finish off this list.
-);
-
my @regFlagsUser = (
# possible chars to include in FLAG
"A", # bot administration over /msg