diff --git a/scripts/antifuck.pl b/scripts/antifuck.pl index 52fad71..67f5915 100644 --- a/scripts/antifuck.pl +++ b/scripts/antifuck.pl @@ -244,25 +244,23 @@ sub irc_join_delay { my $buffer = shift; - for my $server (values %part) { + for my $server (keys %part) { my $chans = ''; - for my $chan (keys %$server) { + for my $chan (keys %{$part{$server}}) { if (length($chans) + length($chan) > 500) { - weechat::command($buffer, "/part $chans"); - #weechat::hook_signal_send('irc_input_send', - # weechat::WEECHAT_HOOK_SIGNAL_STRING, - # "$server;;priority_low;;/part $chans"); + weechat::hook_signal_send('irc_input_send', + weechat::WEECHAT_HOOK_SIGNAL_STRING, + "$server;;priority_low;;/part $chans"); $chans = ''; } $chans .= "$chan,"; } - weechat::command($buffer, "/part $chans"); - #weechat::hook_signal_send('irc_input_send', - # weechat::WEECHAT_HOOK_SIGNAL_STRING, - # "$server;;priority_low;;/part $chans"); + weechat::hook_signal_send('irc_input_send', + weechat::WEECHAT_HOOK_SIGNAL_STRING, + "$server;;priority_low;;/part $chans"); } $timeout_cb = ''; %part = ();