3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

Whoops, do check-bans on join for unidentified users as well when extended-join capability is active

This commit is contained in:
Pragmatic Software 2016-08-30 02:14:21 -07:00
parent 8102e1bc21
commit 2c554328c9
2 changed files with 19 additions and 3 deletions

View File

@ -244,10 +244,10 @@ sub on_join {
if ($event->{event}->{args}[0] ne '*') {
$self->{pbot}->{messagehistory}->{database}->link_aliases($message_account, undef, $event->{event}->{args}[0]);
$self->{pbot}->{antiflood}->check_nickserv_accounts($nick, $event->{event}->{args}[0]);
$self->{pbot}->{messagehistory}->{database}->devalidate_all_channels($message_account);
$self->{pbot}->{antiflood}->check_bans($message_account, $event->{event}->from, $channel);
}
$self->{pbot}->{messagehistory}->{database}->devalidate_channel($message_account, $channel);
$self->{pbot}->{antiflood}->check_bans($message_account, $event->{event}->from, $channel);
}
$self->{pbot}->{antiflood}->check_flood($channel, $nick, $user, $host, $msg,

View File

@ -1015,6 +1015,22 @@ sub get_channel_datas_with_enter_abuses {
return $channel_datas;
}
sub devalidate_channel {
my ($self, $id, $channel, $mode) = @_;
$mode = 0 if not defined $mode;
eval {
my $sth = $self->{dbh}->prepare("UPDATE Channels SET validated = ? WHERE id = ? AND channel = ?");
$sth->bind_param(1, $mode);
$sth->bind_param(2, $id);
$sth->bind_param(3, $channel);
$sth->execute();
$self->{new_entries}++;
};
$self->{pbot}->{logger}->log($@) if $@;
}
sub devalidate_all_channels {
my ($self, $id, $mode) = @_;