3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 04:19:27 +01:00

UrlTitles: Do not show titles for bot-commands

This commit is contained in:
Pragmatic Software 2019-05-31 08:59:59 -07:00
parent 95dc662c0a
commit 4c9496a2b3

View File

@ -46,6 +46,7 @@ sub show_url_titles {
my $msg = $event->{event}->{args}[0]; my $msg = $event->{event}->{args}[0];
return 0 if not $msg =~ m/https?:\/\/[^\s]/; return 0 if not $msg =~ m/https?:\/\/[^\s]/;
return 0 if $event->{interpreted};
if ($self->{pbot}->{ignorelist}->check_ignore($nick, $user, $host, $channel)) { if ($self->{pbot}->{ignorelist}->check_ignore($nick, $user, $host, $channel)) {
my $admin = $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); my $admin = $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host");
@ -67,7 +68,8 @@ 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')) {
while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$event->{interpreted} <= 3) { my $count = 0;
while ($msg =~ s/(https?:\/\/[^\s]+)//i && ++$count <= 3) {
my $url = $1; my $url = $1;
if ($self->{pbot}->{antispam}->is_spam('url', $url)) { if ($self->{pbot}->{antispam}->is_spam('url', $url)) {