Parse Numeric:005 and store PREFIX's data.

This commit is contained in:
Elijah Perrault committed 2011-01-24 19:16:42 -07:00
1 parent 1ca0c9a078
commit 53422a7545
2 files changed
+27 -1

No files matched your search

+26 -1
View File
@@ -12,6 +12,7 @@ use API::IRC;
# Raw parsing hash.
our %RAWC = (
'001' => \&num001,
'005' => \&num005,
'432' => \&num432,
'433' => \&num433,
'438' => \&num438,
@@ -26,7 +27,7 @@ our %RAWC = (
);
# Variables for various functions.
our (%got_001, %botnick, %botchans);
our (%got_001, %botnick, %botchans, %csprefix);
# Events.
API::Std::event_add("on_rcjoin");
@@ -108,6 +109,30 @@ sub num001
return 1;
}
# Parse: Numeric:005
# Prefixes.
sub num005
{
my ($svr, @ex) = @_;
# Find PREFIX.
foreach my $ex (@ex) {
if (substr($ex, 0, 7) eq "PREFIX=") {
# Found.
my $rpx = substr($ex, 8);
my ($pm, $pp) = split('\)', $rpx);
my @apm = split(//, $pm);
my @app = split(//, $pp);
foreach my $ppm (@apm) {
# Store data.
$csprefix{$svr}{$ppm} = shift(@app);
}
}
}
return 1;
}
# Parse: Numeric:432
# Erroneous nickname.
sub num432