Add ability to check if a nick is present in any channels

This commit is contained in:
Pragmatic Software 2017-08-12 01:28:23 -07:00
parent a904fbdccb
commit f3d84931b1
1 changed files with 13 additions and 0 deletions

View File

@ -103,6 +103,19 @@ sub get_channels {
return \@channels;
}
sub is_present_any_channel {
my ($self, $nick) = @_;
$nick = lc $nick;
foreach my $channel (keys %{ $self->{nicklist} }) {
if (exists $self->{nicklist}->{$channel}->{$nick}) {
return $self->{nicklist}->{$channel}->{$nick}->{nick};
}
}
return 0;
}
sub is_present {
my ($self, $channel, $nick) = @_;