diff options
Diffstat (limited to 'lib/IRC')
-rw-r--r-- | lib/IRC/Client.pm6 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 2fa04dc..f9c8c88 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -28,6 +28,12 @@ method handle-event ($e) { return unless $res === IRC_NOT_HANDLED; } + # Wait for END_MOTD or ERR_NOMOTD before attempting to join + if $e<command> eq '422' | '376' { + $.ssay("JOIN {@!channels[]}\n"); + .irc-connected: self for @!plugs.grep(*.^can: 'irc-connected'); + } + my $nick = $!nick; if ( ( $e<command> eq 'PRIVMSG' and $e<params>[0] eq $nick ) or ( $e<command> eq 'NOTICE' and $e<params>[0] eq $nick ) @@ -124,9 +130,6 @@ method run { $.ssay("PASS $!password\n") if $!password.defined; $.ssay("NICK $!nick\n"); $.ssay("USER $!username $!username $!host :$!userreal\n"); - $.ssay("JOIN {@!channels[]}\n"); - - .irc-connected: self for @!plugs.grep(*.^can: 'irc-connected'); # my $left-overs = ''; react { @@ -168,4 +171,4 @@ sub plug-name { $plug ~~ s:g/^ $cur '/' | '.pm6'$//; $plug ~~ s/'/'/::/; return "[$plug] "; -}
\ No newline at end of file +} |