antifuck.pl: sync channels on script load

This commit is contained in:
wowaname 2016-11-27 12:36:58 +00:00
parent 8bce1075ba
commit 17149d0f01

View File

@ -48,6 +48,18 @@ HELP
unless weechat::config_is_set_plugin($option); unless weechat::config_is_set_plugin($option);
weechat::config_set_desc_plugin($option, $OPTIONS{$option}[0]); weechat::config_set_desc_plugin($option, $OPTIONS{$option}[0]);
} }
my $iptr = weechat::infolist_get('buffer', '', '');
while (weechat::infolist_next($iptr)) {
next unless weechat::infolist_string($iptr, 'plugin_name') eq 'irc';
my $buf = weechat::infolist_pointer($iptr, 'pointer');
$channels{
lc weechat::buffer_get_string($buf, 'localvar_server')}{
lc weechat::buffer_get_string($buf, 'localvar_channel')} = 1;
}
weechat::infolist_free($iptr);
} }
sub mynick sub mynick