2 # originally by kevin lenzo.
6 if (&IsParam("useStrict")) { use strict; }
10 my ($ret, $f, $o) = "";
11 my @ind = split //, $flags;
13 $userHandle ||= "default";
15 &DEBUG("isFlag: userHandle == '$userHandle'.");
17 foreach $f (split //, $userList{$userHandle}{'flags'}) {
19 next unless ($f eq $o);
29 my ($nick, $lnuh) = @_;
30 # my ($n,$u,$h) = ($lnuh =~ /^(\S+)!(\S+)\@(\S+)$/);
32 $userHandle = "default";
34 ### FIXME: THIS NEEDS TO BE FIXED TO RECOGNISE HOSTMASKS!!!
36 foreach $user (keys %userList) {
37 ### Hack for time being.
39 if ($user =~ /^\Q$nick\E$/i) {
40 &DEBUG("vU: setting uH => '$user'.");
46 $userinlist = $user if ($user =~ /^\Q$nick\E$/);
49 foreach $m (keys %{$userList{$user}{'mask'}}) {
52 $m =~ s/([\@\(\)\[\]])/\\$1/g;
54 next unless ($lnuh =~ /^$m$/i);
55 &DEBUG("vUser: $lnuh matched masked ($m). Good!");
61 last if ($userHandle ne "");
64 if ($userinlist and $userHandle eq "") {
65 &DEBUG("vUser: user is in list but wrong host.");
66 $userHandle = $userinlist;
70 if (&IsParam("seen") and $msgType =~ /public/) {
71 $seencache{$who}{'time'} = time();
72 $seencache{$who}{'nick'} = $orig{who};
73 $seencache{$who}{'host'} = $uh;
74 $seencache{$who}{'chan'} = $talkchannel;
75 $seencache{$who}{'msg'} = $orig{message};
76 $seencache{$who}{'msgcount'}++;
79 # $talkWho{$talkchannel} = $orig{who};
80 # $talkWho = $orig{who};
82 $talkWho{$talkchannel} = $who if (defined $talkchannel);
89 # returns true if arg1 encrypts to arg2
90 my ($plain, $encrypted) = @_;
91 if ($encrypted eq "") {
92 ($plain, $encrypted) = split(/\s+/, $plain, 2);
94 return 0 unless ($plain ne "" and $encrypted ne "");
96 # MD5 // DES. Bobby Billingsley++.
97 my $salt = substr($encrypted, 0, 2);
98 if ($encrypted =~ /^\$\d\$(\w\w)\$/) {
102 return ($encrypted eq crypt($plain, $salt));
105 # mainly for dcc chat... hrm.
109 if (&IsFlag($flag) eq $flag) {
112 &status("DCC CHAT: <$who> $message -- not enough flags.");
113 &performStrictReply("error: you do not have enough flags for that. ($flag required)");