From f68160a074cc912179d27c361429a126072fb734 Mon Sep 17 00:00:00 2001 From: wowaname Date: Sun, 27 Nov 2016 21:11:36 +0000 Subject: [PATCH] antifuck.pl: plugins.var.perl.antifuck.forward works, /join 0 works --- scripts/antifuck.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; }