JOIN: |-
sub {
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
- if( $what =~ /^[#&][^ ,]+$/ ) {
- $kernel->post( $src, "do_join", $what );
+ my( $chan, $key ) = split( / /, $what, 2 );
+ if( $chan =~ /^[#&][^ ,]+$/ ) {
+ $kernel->post( $src, "do_join", $chan, $key );
$kernel->post( $src, $replypath, "Okay.", $dest );
} else {
- $kernel->post( $src, $replypath, "'$what' is not a valid channel name.", $dest );
+ $kernel->post( $src, $replypath, "'$chan' is not a valid channel name.", $dest );
}
}
}
sub do_join {
- my( $kernel, $heap, $what ) = @_[ KERNEL, HEAP, ARG0 ];
+ my( $kernel, $heap, $what, $key ) = @_[ KERNEL, HEAP, ARG0 ];
if( $what =~ /^[#&][^ ,]+$/ ) {
print( "IRC : Joining '$what'\n" );
- $kernel->post( $heap->{ 'ircobject' }->session_id(), "join", $what );
+ $kernel->post( $heap->{ 'ircobject' }->session_id(), "join", $what, $key );
} else {
warn( "'$what' is an invalid channel name" );
}