diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 3250069..29559f4 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added $got_001 to Parser::IRC for checking if we've been + sent 001. * Renamed API::IRC::mode() to cmode() * Added mod_init() and mod_void() to API::Std. * Use Class::Unload. diff --git a/src/API/IRC.pm b/src/API/IRC.pm index 89ba04a..c137c11 100644 --- a/src/API/IRC.pm +++ b/src/API/IRC.pm @@ -69,5 +69,7 @@ sub quit { else { Auto::socksnd($svr, "QUIT :Leaving"); } + + delete $Parser::IRC::got_001{$svr} if (defined $Parser::IRC::got_001{$svr}); } diff --git a/src/Parser/IRC.pm b/src/Parser/IRC.pm index f24779c..1edab50 100644 --- a/src/Parser/IRC.pm +++ b/src/Parser/IRC.pm @@ -14,6 +14,9 @@ our %RAWC = ( '001' => \&num001, ); +# Variables for various functions. +our (%got_001); + # Parse raw data. sub _parse { @@ -47,6 +50,8 @@ sub num001 { my ($svr, @ex) = @_; + $got_001{$svr} = 1; + # Get the auto-join from the config. my @cajoin = @{ (conf_get("server:$svr:ajoin"))[0] };