3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-29 15:29:32 +01:00

NickList: NAMREPLY: ensure $hostmask is defined

This commit is contained in:
Pragmatic Software 2019-12-30 16:12:10 -08:00
parent 3f4c85bcdc
commit aca793928a

View File

@ -271,10 +271,13 @@ sub on_namreply {
$self->add_nick($channel, $stripped_nick); $self->add_nick($channel, $stripped_nick);
my ($account_id, $hostmask) = $self->{pbot}->{messagehistory}->{database}->find_message_account_by_nick($stripped_nick); my ($account_id, $hostmask) = $self->{pbot}->{messagehistory}->{database}->find_message_account_by_nick($stripped_nick);
my ($user, $host) = $hostmask =~ m/[^!]+!([^@]+)@(.*)/;
$self->set_meta($channel, $stripped_nick, 'hostmask', $hostmask); if (defined $hostmask) {
$self->set_meta($channel, $stripped_nick, 'user', $user); my ($user, $host) = $hostmask =~ m/[^!]+!([^@]+)@(.*)/;
$self->set_meta($channel, $stripped_nick, 'host', $host); $self->set_meta($channel, $stripped_nick, 'hostmask', $hostmask);
$self->set_meta($channel, $stripped_nick, 'user', $user);
$self->set_meta($channel, $stripped_nick, 'host', $host);
}
if ($nick =~ m/\@/) { if ($nick =~ m/\@/) {
$self->set_meta($channel, $stripped_nick, '+o', 1); $self->set_meta($channel, $stripped_nick, '+o', 1);