From 7e6aad9ad382479d7f3bd3f5235a8bed73d8fb8b Mon Sep 17 00:00:00 2001 From: wowaname Date: Sun, 27 Nov 2016 13:35:56 +0000 Subject: [PATCH] antifuck.pl: support for numeric 470 (channel forwarding) --- scripts/antifuck.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/antifuck.pl b/scripts/antifuck.pl index cc84062..0a96df4 100644 --- a/scripts/antifuck.pl +++ b/scripts/antifuck.pl @@ -42,6 +42,7 @@ HELP weechat::hook_signal('*,irc_out1_join', 'client_join', ''); weechat::hook_signal('*,irc_out1_part', 'client_part', ''); weechat::hook_signal('*,irc_raw_in_001', 'irc_001', ''); + weechat::hook_signal('*,irc_raw_in_470', 'irc_470', ''); weechat::hook_modifier('irc_in_366', 'irc_366', ''); weechat::hook_modifier('irc_in_part', 'irc_part', ''); @@ -226,6 +227,18 @@ sub irc_366 return ''; } +sub irc_470 +{ + my (undef, $server, $oldchan, $newchan) = (shift, + shift =~ /(.+),irc_raw_in_470/, + shift =~ /^:[^ ]* 470 [^ ]+ ([^ ]+) ([^ ]+)/); + ($server, $oldchan, $newchan) = (lc $server, lc $oldchan, lc $newchan); + + delete $channels{$server}{$oldchan}; + $channels{$server}{$newchan} = 1; + return weechat::WEECHAT_RC_OK; +} + sub irc_join_delay { my $buffer = shift;