'O', # dynamic ops (as on channel). (automatic +o)
'T', # add topics.
'a', # ask/request factoid.
- 'm', # modify factoid. (includes renaming)
+ 'm', # modify all factoids. (includes renaming)
+ 'M', # modify own factoids. (includes renaming)
'n', # bot owner, can 'reload'
'o', # master of bot (automatic +amrt)
# can search on factoid strings shorter than 2 chars
my $f = "$bot_state_dir/infobot.users";
if ( !-f $f ) {
- &DEBUG("userfile not found; new fresh run detected.");
+ &DEBUG('userfile not found; new fresh run detected.');
return;
}
my $s2 = -s "$f~";
if ( $s2 > $s1 * 3 ) {
- &FIXME("rUF: backup file bigger than current file.");
+ &FIXME('rUF: backup file bigger than current file.');
}
}
my $ver = <IN>;
if ( $ver !~ /^#v1/ ) {
- &ERROR("old or invalid user file found.");
+ &ERROR('old or invalid user file found.');
&closeLog();
exit 1; # correct?
}
&status(
sprintf(
- "USERFILE: Loaded: %d users, %d bans, %d ignore",
+ 'USERFILE: Loaded: %d users, %d bans, %d ignore',
scalar( keys %users ) - 1,
scalar( keys %bans ), # ??
scalar( keys %ignore ), # ??
sub writeUserFile {
if ( !scalar keys %users ) {
- &DEBUG("wUF: nothing to write.");
+ &DEBUG('wUF: nothing to write.');
return;
}
"--- Saved USERFILE ($cusers users; $cbans bans; $cignore ignore) at $time"
);
if ( defined $msgType and $msgType =~ /^chat$/ ) {
- &performStrictReply("--- Writing user file...");
+ &performStrictReply('--- Writing user file...');
}
}
my $s2 = -s "$f~";
if ( $s2 > $s1 * 3 ) {
- &FIXME("rCF: backup file bigger than current file.");
+ &FIXME('rCF: backup file bigger than current file.');
}
}
}
&status(
- "CHANFILE: Loaded: " . ( scalar( keys %chanconf ) - 1 ) . " chans" );
+ 'CHANFILE: Loaded: ' . ( scalar( keys %chanconf ) - 1 ) . ' chans' );
}
sub writeChanFile {
if ( !scalar keys %chanconf ) {
- &DEBUG("wCF: nothing to write.");
+ &DEBUG('wCF: nothing to write.');
return;
}
foreach ( keys %chanconf ) {
$chan = $_;
- next if ( $chan eq "_default" );
+ next if ( $chan eq '_default' );
next unless ( exists $chanconf{$chan}{$opt} );
next unless ( $val eq $chanconf{$chan}{$opt} );
my ( %optsval, %opts );
foreach ( keys %chanconf ) {
$chan = $_;
- next if ( $chan eq "_default" );
+ next if ( $chan eq '_default' );
my $opt;
foreach ( keys %{ $chanconf{$chan} } ) {
close OUT;
$wtime_chanfile = time();
- &status("--- Saved CHANFILE ("
+ &status('--- Saved CHANFILE ('
. scalar( keys %chanconf )
. " chans) at $time" );
if ( defined $msgType and $msgType =~ /^chat$/ ) {
- &performStrictReply("--- Writing chan file...");
+ &performStrictReply('--- Writing chan file...');
}
}
$userHandle = '';
foreach $user ( keys %users ) {
- next if ( $user eq "_default" );
+ next if ( $user eq '_default' );
foreach $m ( keys %{ $users{$user}{HOSTS} } ) {
$m =~ s/\?/./g;
}
}
- $userHandle ||= "_default";
+ $userHandle ||= '_default';
# what's talkchannel for?
$talkWho{$talkchannel} = $who if ( defined $talkchannel );
push( @match, $chan );
}
- &DEBUG( "iD: scalar => " . scalar( keys %{ $ignore{$chan} } ) );
+ &DEBUG( 'iD: scalar => ' . scalar( keys %{ $ignore{$chan} } ) );
}
if ( scalar @match ) {
push( @match, $chan );
}
- &DEBUG( "bans: scalar => " . scalar( keys %{ $bans{$chan} } ) );
+ &DEBUG( 'bans: scalar => ' . scalar( keys %{ $bans{$chan} } ) );
}
if ( scalar @match ) {
my ($user) = @_;
if ( !defined $user ) {
- &WARN("getUser: user == NULL.");
+ &WARN('getUser: user == NULL.');
return;
}
sub chanSet {
my ( $cmd, $chan, $what, $val ) = @_;
- if ( $cmd eq "+chan" ) {
+ if ( $cmd eq 'chanadd' ) {
if ( exists $chanconf{$chan} ) {
&performStrictReply("chan $chan already exists.");
return;
my $update = 0;
if ( defined $what and $what =~ s/^([+-])(\S+)/$2/ ) {
- ### ".chanset +blah"
- ### ".chanset +blah 10" -- error.
+ ### '.chanset +blah'
+ ### '.chanset +blah 10' -- error.
- my $set = ( $1 eq "+" ) ? 1 : 0;
+ my $set = ( $1 eq '+' ) ? 1 : 0;
my $was = $chanconf{$chan}{$what};
if ($set) { # add/set.
}
elsif ( defined $val ) {
- ### ".chanset blah testing"
+ ### '.chanset blah testing'
my $was = $chanconf{$chan}{$what};
if ( defined $was and $was eq $val ) {
}
else { # read only.
- ### ".chanset"
- ### ".chanset blah"
+ ### '.chanset'
+ ### '.chanset blah'
if ( !defined $what ) {
- &WARN("chanset/DC: what == undefine.");
+ &WARN('chanset/DC: what == undefine.');
return;
}
}
}
- &DEBUG("end of rehashConfVars");
+ &DEBUG('end of rehashConfVars');
delete $cache{confvars};
}