mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-22 09:12:22 -05:00
perl: Fixed get_list('networks') to work with new servlist.conf syntax for autojoin channels.
This commit is contained in:
parent
6e3f05fcc7
commit
c7d1102c61
@ -10,27 +10,25 @@ use overload
|
|||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $line = shift;
|
|
||||||
|
|
||||||
my @autojoins;
|
my @autojoins;
|
||||||
|
|
||||||
if ( $line ) {
|
return bless \@autojoins, $class;
|
||||||
my ( $channels, $keys ) = split / /, $line, 2;
|
}
|
||||||
my @channels = split /,/, $channels;
|
|
||||||
my @keys = split /,/, ($keys || '');
|
|
||||||
|
|
||||||
for my $channel ( @channels ) {
|
sub add {
|
||||||
my $key = shift @keys;
|
my $self = shift;
|
||||||
$key = '' unless defined $key;
|
|
||||||
|
|
||||||
push @autojoins, {
|
my $line = shift;
|
||||||
|
|
||||||
|
my ( $channel, $key ) = split /,/, $line, 2;
|
||||||
|
$key = $key || '';
|
||||||
|
|
||||||
|
push @$self, {
|
||||||
channel => $channel,
|
channel => $channel,
|
||||||
key => $key,
|
key => $key,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return bless \@autojoins, $class;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub channels {
|
sub channels {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -39,6 +39,8 @@ sub parse {
|
|||||||
my @fields = split /\n/, $data;
|
my @fields = split /\n/, $data;
|
||||||
chomp @fields;
|
chomp @fields;
|
||||||
|
|
||||||
|
$entry->{ autojoins } = Xchat::List::Network::AutoJoin->new();
|
||||||
|
|
||||||
for my $field ( @fields ) {
|
for my $field ( @fields ) {
|
||||||
SWITCH: for ( $field ) {
|
SWITCH: for ( $field ) {
|
||||||
/^($letter_key_re)=(.*)/ && do {
|
/^($letter_key_re)=(.*)/ && do {
|
||||||
@ -47,8 +49,7 @@ sub parse {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/^J.(.*)/ && do {
|
/^J.(.*)/ && do {
|
||||||
$entry->{ autojoins } =
|
$entry->{ autojoins }->add( $1 );
|
||||||
Xchat::List::Network::AutoJoin->new( $1 );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/^F.(.*)/ && do {
|
/^F.(.*)/ && do {
|
||||||
|
Loading…
Reference in New Issue
Block a user