3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

UrlTitles: check urls against AntiSpam

This commit is contained in:
Pragmatic Software 2018-08-06 09:41:18 -07:00
parent 96d23b6177
commit a8d8c90454

View File

@ -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);