diff --git a/scripts/antifuck.pl b/scripts/antifuck.pl index 0a96df4..59f5596 100644 --- a/scripts/antifuck.pl +++ b/scripts/antifuck.pl @@ -172,7 +172,8 @@ sub client_join shift =~ /^join :?([^ ]*)/i); ($server, $channel) = (lc $server, lc $channel); - $channels{$server}{$_} = 1 for (split ',', $channel); + ($_ eq '0' ? %{$channels{$server}} = () : $channels{$server}{$_} = 1) + for (split ',', $channel); return weechat::WEECHAT_RC_OK; } @@ -183,7 +184,7 @@ sub client_part shift =~ /^part ([^ ]*)/i); ($server, $channel) = (lc $server, lc $channel); - delete $channels{$server}{$channel}; + delete $channels{$server}{$_} for (split ',', $channel); return weechat::WEECHAT_RC_OK; } @@ -235,7 +236,7 @@ sub irc_470 ($server, $oldchan, $newchan) = (lc $server, lc $oldchan, lc $newchan); delete $channels{$server}{$oldchan}; - $channels{$server}{$newchan} = 1; + $channels{$server}{$newchan} = 1 if weechat::config_get_plugin('forward'); return weechat::WEECHAT_RC_OK; }