From 559b9ddde1987760a6b2cdc6ff347584825fe844 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 14 Feb 2015 04:03:39 -0800 Subject: [PATCH] Use NickList instead of MessageHistory for target channels --- PBot/IRCHandlers.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 8bc5c67a..9cd1124d 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -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}); }