3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-26 20:52:37 +01:00

Users.pm: fixes

This commit is contained in:
Pragmatic Software 2020-01-26 12:28:38 -08:00
parent 6a1fbc1c78
commit 4db3a2ec01

View File

@ -145,7 +145,6 @@ sub find_user_account {
$channel = lc $channel;
$hostmask = lc $hostmask;
$channel = '.*' if $channel !~ /^#/;
my ($found_channel, $found_hostmask) = ($channel, $hostmask);
foreach my $chan (keys %{ $self->{users}->{hash} }) {
@ -177,6 +176,8 @@ sub find_user_account {
}
}
}
} else {
$found_channel = $chan;
}
}
}
@ -446,7 +447,7 @@ sub mycmd {
my $name = $nick;
my ($existing_channel, $existing_hostmask) = $self->find_user_account($channel, $name);
if ($existing_hostmask ne $name) {
if ($existing_hostmask ne lc $name) {
# user exists by name
return "There is already an user account named $name but it does not match your hostmask. Ask an admin for help.";
}