antifuck.pl: plugins.var.perl.antifuck.forward works, /join 0 works

This commit is contained in:
wowaname 2016-11-27 21:11:36 +00:00
parent 7e6aad9ad3
commit f68160a074

View File

@ -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;
}