# NOTE: Merged from User.pl
#
-#use strict;
+use strict;
+
+use vars qw(%chanconf %cache %bans %channels %nuh %users %ignore
+ %talkWho %dcc %mask);
+use vars qw($utime_userfile $ucount_userfile $utime_chanfile $who
+ $ucount_chanfile $userHandle $chan $msgType $talkchannel
+ $ident $bot_state_dir $talkWho $flag_quit $wtime_userfile
+ $wcount_userfile $wtime_chanfile $nuh $message);
#####
##### USERFILE CONFIGURATION READER/WRITER
##### USER COMMANDS.
#####
+# todo: support multiple flags.
sub IsFlag {
my $flags = shift;
my ($ret, $f, $o) = "";
sub verifyUser {
my ($nick, $lnuh) = @_;
- my ($user,$m);
+ my ($user, $m);
if ($userHandle = $dcc{'CHATvrfy'}{$who}) {
&VERB("vUser: cached auth for $who.",2);
my $count ||= 0;
if ($expire > 0) {
- $expire = $expire*60 + time();
+ $expire = ($expire*60) + time();
} else {
$expire = 0;
}
$ignore{$chan}{$mask} = [$expire, time(), $who, $comment];
# todo: improve this.
- &status("ignore: Added $mask for $chan to expire $expire, by $who, for $comment");
+ if ($expire == 0) {
+ &status("ignore: Added $mask for $chan to NEVER expire, by $who, for $comment");
+ } else {
+ &status("ignore: Added $mask for $chan to expire $expire mins, by $who, for $comment");
+ }
if ($exist) {
$utime_userfile = time();
return;
}
$chanconf{$chan}{_time_added} = time();
- $chanconf{$what}{autojoin} = 1;
+ $chanconf{$chan}{autojoin} = 1;
&pSReply("Joining $chan...");
&joinchan($chan);
my $update = 0;
- ### ".chanset +blah"
- ### ".chanset +blah 10" -- error.
if (defined $what and $what =~ s/^([+-])(\S+)/$2/) {
+ ### ".chanset +blah"
+ ### ".chanset +blah 10" -- error.
+
my $state = ($1 eq "+") ? 1 : 0;
my $was = $chanconf{$chan}{$what};
return;
}
- $was = ($was) ? "; was '$was'" : "";
$val = 1;
} else { # delete/unset.
return;
}
- $was = ($was) ? "; was '$was'" : "";
$val = 0;
}
+ # alter for cosmetic (print out) reasons only.
+ $was = ($was) ? "; was '$was'" : "";
+
if ($val eq "0") {
&pSReply("Unsetting $what for $chan$was.");
delete $chanconf{$chan}{$what};
$update++;
- ### ".chanset blah testing"
} elsif (defined $val) {
+ ### ".chanset blah testing"
+
my $was = $chanconf{$chan}{$what};
if (defined $was and $was eq $val) {
&pSReply("setting $what for $chan already '$val'.");
$update++;
- ### ".chanset"
- ### ".chanset blah"
} else { # read only.
+ ### ".chanset"
+ ### ".chanset blah"
+
if (!defined $what) {
&WARN("chanset/DC: what == undefine.");
return;
}
sub rehashConfVars {
- # this is an attempt to fix where an option is loaded but the module
- # has not loaded. it also can be used for other things.
+ # this is an attempt to fix where an option is enabled but the module
+ # has been not loaded. it also can be used for other things.
foreach (keys %{ $cache{confvars} }) {
my $i = $cache{confvars}{$_};
delete $cache{confvars};
}
+# following arrays are not used... forgot what I intended to use them for.
my @regFlagsChan = (
"autojoin",
"freshmeat",
);
my @regFlagsUser = (
- "m", # master
- "n", # owner
- "o", # op
+ "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...
1;