my $s2 = -s "$f~";
if ($s2 > $s1*3) {
- &DEBUG("rUF: backup file bigger than current file. FIXME");
+ &FIXME("rUF: backup file bigger than current file.");
}
}
print OUT "--$what\t\t$_\n";
}
+ } elsif ($_ eq 'FLAGS') {
+ print OUT "--$_\t\t" . join('', sort split('', $val)) . "\n";
} else {
print OUT "--$_\t\t$val\n";
}
$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...");
}
}
my $s2 = -s "$f~";
if ($s2 > $s1*3) {
- &DEBUG("rCF: backup file bigger than current file. FIXME");
+ &FIXME("rCF: backup file bigger than current file.");
}
}
$cache{negative} = 1;
# $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 {
" chans) at $time");
if (defined $msgType and $msgType =~ /^chat$/) {
- &pSReply("--- Writing chan file...");
+ &performStrictReply("--- Writing chan file...");
}
}
##### USER COMMANDS.
#####
-# todo: support multiple flags.
+# TODO: support multiple flags.
+# TODO: return all flags for opers
sub IsFlag {
my $flags = shift;
my ($ret, $f, $o) = "";
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;
}
}
+# expire is time in minutes
sub ignoreAdd {
my($mask,$chan,$expire,$comment) = @_;
$ignore{$chan}{$mask} = [$expire, time(), $who, $comment];
- # todo: improve this.
+ # TODO: improve this.
if ($expire == 0) {
&status("ignore: Added $mask for $chan to NEVER expire, by $who, for $comment");
} else {
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} = 1;
+ $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;
}
if ($state) { # 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.");
+ &performStrictReply("setting $what for $chan is not set.");
return;
}
if ($was eq "0") {
- &pSReply("setting $what for $chan already 0.");
+ &performStrictReply("setting $what for $chan already 0.");
return;
}
$was = ($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.");
}
}
&DEBUG("rehashConfVars: _ => $_");
if (/^news$/ and $i) {
- &loadMyModule("news");
+ &loadMyModule('News');
delete $cache{confvars}{$_};
}
if (/^uptime$/ and $i) {
- &loadMyModule("uptime");
+ &loadMyModule('Uptime');
delete $cache{confvars}{$_};
}
if (/^rootwarn$/i and $i) {
- &loadMyModule($_);
+ &loadMyModule('RootWarn');
delete $cache{confvars}{$_};
}
}
delete $cache{confvars};
}
-# following arrays are not used... forgot what I intended to use them for.
-my @regFlagsChan = (
- "autojoin",
- "freshmeat",
- "limitcheckInterval",
- "limitcheckPlus",
- "allowConv",
- "allowDNS",
-### TODO: finish off this list.
-);
-
my @regFlagsUser = (
- "m", # modify factoid.
- "r", # remove factoid.
- "s", # search (deprecated)
- "t", # teach/add factoid.
- "a", # ask/request factoid.
- "n", # bot owner
- "o", # master of bot (automatic +amrt)
- "O", # dynamic ops (as on channel). (automatic +o)
-); # todo...
+ # possible chars to include in FLAG
+ "A", # bot administration over /msg
+ # default is only via DCC CHAT
+ "O", # dynamic ops (as on channel). (automatic +o)
+ "T", # add topics.
+ "a", # ask/request factoid.
+ "m", # modify factoid. (includes renaming)
+ "n", # bot owner, can "reload"
+ "o", # master of bot (automatic +amrt)
+ # can search on factoid strings shorter than 2 chars
+ # can tell bot to join new channels
+ # can [un]lock factoids
+ "r", # remove factoid.
+ "t", # teach/add factoid.
+);
1;
-
-#####
-# Userflags
-# +r - ability to remove factoids
-# +t - ability to teach factoids
-# +m - ability to modify factoids
-# +n - bot owner
-# +o - authorised user of bot (like +m on eggdrop)
-#####