Fix the join-on-connect for channels with keys
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 26 Mar 2008 14:54:14 +0000 (14:54 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 26 Mar 2008 14:54:14 +0000 (14:54 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@40 088b83a4-0077-4247-935c-42ec02c2848b

irc.pl

diff --git a/irc.pl b/irc.pl
index f9015bc..53fb058 100644 (file)
--- a/irc.pl
+++ b/irc.pl
@@ -156,7 +156,14 @@ sub on_connect {
        for my $chan (split( /,/, $self->{ "channel" } )) {
                my @args = split( /:/, $chan );
                my $chanName = shift @args;
-               $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chan, @args );
+               print( "IRC : Connecting to $chanName" );
+               if( $#args >= 0 ) {
+                       print( " with arguments ".join( ',', @args ), "\n" );
+                       $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chanName, @args );
+               } else {
+                       print( "\n" );
+                       $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chanName );
+               }
        }
 }