From f76182b53077a999dd8ffb0a2180bffed23014e0 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Thu, 20 Mar 2008 15:47:10 +0000 Subject: [PATCH] Allow keys to be specified in channels git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@39 088b83a4-0077-4247-935c-42ec02c2848b --- irc.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ); } } -- 2.11.0