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;