mirror of
https://github.com/pragma-/pbot.git
synced 2024-10-07 03:49:04 +02:00
UrlTitles: check urls against AntiSpam
This commit is contained in:
parent
96d23b6177
commit
a8d8c90454
@ -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 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')) {
|
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) {
|
while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$event->{interpreted} <= 3) {
|
||||||
|
my $url = $1;
|
||||||
|
|
||||||
my $stuff = {
|
my $stuff = {
|
||||||
from => $channel, nick => $nick, user => $user, host => $host,
|
from => $channel, nick => $nick, user => $user, host => $host,
|
||||||
command => "title $nick $1", root_channel => $channel, root_keyword => "title",
|
command => "title $nick $url", root_channel => $channel, root_keyword => "title",
|
||||||
keyword => "title", arguments => "$nick $1"
|
keyword => "title", arguments => "$nick $url"
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($stuff);
|
$self->{pbot}->{factoids}->{factoidmodulelauncher}->execute_module($stuff);
|
||||||
|
Loading…
Reference in New Issue
Block a user