diff --git a/PBot/Plugins/UrlTitles.pm b/PBot/Plugins/UrlTitles.pm index 54b05d09..d151a64c 100644 --- a/PBot/Plugins/UrlTitles.pm +++ b/PBot/Plugins/UrlTitles.pm @@ -59,11 +59,15 @@ sub show_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')) { + return 0 if $self->{pbot}->{antispam}->is_spam('url', $msg); + while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$event->{interpreted} <= 3) { + my $url = $1; + my $stuff = { from => $channel, nick => $nick, user => $user, host => $host, - command => "title $nick $1", root_channel => $channel, root_keyword => "title", - keyword => "title", arguments => "$nick $1" + command => "title $nick $url", root_channel => $channel, root_keyword => "title", + keyword => "title", arguments => "$nick $url" }; $self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($stuff);