From: pdbogen Date: Thu, 20 Mar 2008 15:47:10 +0000 (+0000) Subject: Allow keys to be specified in channels X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=f76182b53077a999dd8ffb0a2180bffed23014e0;p=destult.git Allow keys to be specified in channels git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@39 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/irc.pl b/irc.pl index 7b26db8..f9015bc 100644 --- a/irc.pl +++ b/irc.pl @@ -154,7 +154,9 @@ sub on_connect { } print( "IRC : Connected to irc://".$self->{ "host" }."/".$self->{ "channel" }."\n" ); for my $chan (split( /,/, $self->{ "channel" } )) { - $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chan ); + my @args = split( /:/, $chan ); + my $chanName = shift @args; + $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chan, @args ); } } @@ -200,6 +202,7 @@ sub on_private { sub send_public { my( $kernel, $heap, $msg ) = @_[ KERNEL, HEAP, ARG0 ]; for my $chan (split( /,/, $self->{ "channel" } ) ) { + $chan = (split( /:/, $chan ))[0]; $kernel->yield( "send_public_to", $msg, $chan ); } }