Skip to content

Commit

Permalink
ISupport.pm: Fix parsing of MODES and SILENCE parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Jan 26, 2009
1 parent 3b65873 commit d71eec5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for Perl extension POE::Component::IRC.

5.91_01
- ISupport.pm: Fix parsing of MODES and SILENCE parameters (Hinrik)
- AutoJoin.pm: Added 'Rejoin_delay' option (Hinrik)
- Connector.pm: Allow adjusting the time to wait before reconnecting,
to ease testing. (Hinrik)
Expand Down
33 changes: 10 additions & 23 deletions lib/POE/Component/IRC/Plugin/ISupport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;
use POE::Component::IRC::Plugin qw(:ALL);

our $VERSION = '0.57';
our $VERSION = '0.58';

sub new {
return bless { }, shift;
Expand All @@ -18,12 +18,11 @@ sub PCI_register {
$self->{parser} = {
CASEMAPPING => sub {
my ($support, $key, $val) = @_;
$support->{ $key } = $val;
$support->{$key} = $val;
},
CHANLIMIT => sub {
my ($support, $key, $val) = @_;
while ($val =~ /([^:]+):(\d+),?/g) {
my ($k, $v) = ($1, $2);
while (my ($k, $v) = $val =~ /([^:]+):(\d+),?/g) {
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k;
}
},
Expand Down Expand Up @@ -55,40 +54,28 @@ sub PCI_register {
},
PREFIX => sub {
my ($support, $key, $val) = @_;
if ( my ($k, $v) = $val =~ /\(([^)]+)\)(.*)/ ) {
if (my ($k, $v) = $val =~ /\(([^)]+)\)(.*)/ ) {
@{ $support->{$key} }{ split(//, $k) } = split(//, $v);
}
},
SILENCE => sub {
my ($support, $key, $val) = @_;
$support->{$key} = length($val) ? $val : 'off';
},
STATUSMSG => sub {
my ($support, $key, $val) = @_;
$support->{$key} = [ split(//, $val) ];
},
TARGMAX => sub {
my ($support, $key, $val) = @_;
while ($val =~ /([^:]+):(\d*),?/g) {
$support->{$key}->{$1} = $2;
}
while (my ($k, $v) = $val =~ /([^:]+):(\d*),?/g) {
$support->{$key}->{$k} = $v;
}
},
EXCEPTS => sub {
my ($support, $flag) = @_;
$support->{$flag} = 'e';
},
INVEX => sub {
INVEX => sub {
my ($support, $flag) = @_;
$support->{$flag} = 'I';
},
MODES => sub {
my ($support, $flag) = @_;
$support->{$flag} = '';
},
SILENCE => sub {
my ($support, $flag) = @_;
$support->{$flag} = 'off';
},
};

return 1;
Expand Down Expand Up @@ -125,8 +112,8 @@ sub S_005 {
}
else {
# AWAYLEN CHANNELLEN CHIDLEN EXCEPTS INVEX KICKLEN MAXBANS
# MAXCHANNELS MAXTARGETS MODES NETWORK NICKLEN SILENCE STD
# TOPICLEN WATCH
# MAXCHANNELS MAXTARGETS MODES NETWORK NICKLEN STD TOPICLEN
# WATCH
$support->{$key} = $val;
}
}
Expand Down

0 comments on commit d71eec5

Please sign in to comment.