3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Use NickList instead of MessageHistory for target channels

This commit is contained in:
Pragmatic Software 2015-02-14 04:03:39 -08:00
parent 800b097a34
commit 559b9ddde1

View File

@ -277,8 +277,8 @@ sub on_departure {
if($text =~ m/^QUIT/) {
# QUIT messages must be dispatched to each channel the user is on
my @channels = $self->{pbot}->{messagehistory}->{database}->get_channels($message_account);
foreach my $chan (@channels) {
my $channels = $self->{pbot}->{nicklist}->get_channels($nick);
foreach my $chan (@$channels) {
next if $chan !~ m/^#/;
$self->{pbot}->{messagehistory}->add_message($message_account, "$nick!$user\@$host", $chan, $text, $self->{pbot}->{messagehistory}->{MSG_DEPARTURE});
}
@ -308,8 +308,8 @@ sub on_nickchange {
my $message_account = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host);
$self->{pbot}->{messagehistory}->{database}->devalidate_all_channels($message_account, $self->{pbot}->{antiflood}->{NEEDS_CHECKBAN});
my @channels = $self->{pbot}->{messagehistory}->{database}->get_channels($message_account);
foreach my $channel (@channels) {
my $channels = $self->{pbot}->{nicklist}->get_channels($nick);
foreach my $channel (@$channels) {
next if $channel !~ m/^#/;
$self->{pbot}->{messagehistory}->add_message($message_account, "$nick!$user\@$host", $channel, "NICKCHANGE $newnick", $self->{pbot}->{messagehistory}->{MSG_NICKCHANGE});
}