antifuck.pl: support for numeric 470 (channel forwarding)

This commit is contained in:
wowaname 2016-11-27 13:35:56 +00:00
parent 89c8761691
commit 7e6aad9ad3

View File

@ -42,6 +42,7 @@ HELP
weechat::hook_signal('*,irc_out1_join', 'client_join', ''); weechat::hook_signal('*,irc_out1_join', 'client_join', '');
weechat::hook_signal('*,irc_out1_part', 'client_part', ''); weechat::hook_signal('*,irc_out1_part', 'client_part', '');
weechat::hook_signal('*,irc_raw_in_001', 'irc_001', ''); 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_366', 'irc_366', '');
weechat::hook_modifier('irc_in_part', 'irc_part', ''); weechat::hook_modifier('irc_in_part', 'irc_part', '');
@ -226,6 +227,18 @@ sub irc_366
return ''; 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 sub irc_join_delay
{ {
my $buffer = shift; my $buffer = shift;