From 278ce87640d4ce223ad2442e8c2d7b9a923c3e68 Mon Sep 17 00:00:00 2001 From: wowaname Date: Tue, 24 Jan 2017 05:59:21 +0000 Subject: [PATCH] antifuck: use priority_low for autoparts --- scripts/antifuck.pl | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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 = ();