3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

Move URL titles conditional out of loop

This commit is contained in:
Pragmatic Software 2015-09-08 04:43:24 -07:00
parent c57c9e2f13
commit 6c5c263ed2

View File

@ -48,12 +48,13 @@ sub show_url_titles {
}
}
while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$event->{interpreted} <= 3) {
my $url = $1;
if($self->{pbot}->{registry}->get_value('general', 'show_url_titles') and not $self->{pbot}->{registry}->get_value($channel, 'no_url_titles')
if($self->{pbot}->{registry}->get_value('general', 'show_url_titles')
and not $self->{pbot}->{registry}->get_value($channel, 'no_url_titles')
and not grep { $channel =~ /$_/i } $self->{pbot}->{registry}->get_value('general', 'show_url_titles_ignore_channels')
and grep { $channel =~ /$_/i } $self->{pbot}->{registry}->get_value('general', 'show_url_titles_channels')) {
$self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($channel, undef, $nick, $user, $host, $msg, "title", "$nick $url");
while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$event->{interpreted} <= 3) {
$self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($channel, undef, $nick, $user, $host, $msg, "title", "$nick $1");
}
}