From: pdbogen Date: Wed, 12 Sep 2007 22:02:16 +0000 (+0000) Subject: Channel separator is now comma; rewrite send_public to delegate to send_public_to X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=c72fe2ea31acf2d160d872ce96495eeb57644133;p=destult.git Channel separator is now comma; rewrite send_public to delegate to send_public_to git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@30 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/irc.pl b/irc.pl index 7ec6020..7283010 100644 --- a/irc.pl +++ b/irc.pl @@ -153,7 +153,7 @@ sub on_connect { $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "privmsg", "nickserv", "identify ".$self->{ "password" } ); } print( "IRC : Connected to irc://".$self->{ "host" }."/".$self->{ "channel" }."\n" ); - for my $chan (split( / /, $self->{ "channel" } )) { + for my $chan (split( /,/, $self->{ "channel" } )) { $_[KERNEL]->post( $heap->{ 'ircobject' }->session_id(), "join", $chan ); } } @@ -199,12 +199,9 @@ sub on_private { sub send_public { my( $kernel, $heap, $msg ) = @_[ KERNEL, HEAP, ARG0 ]; - local( $Text::Wrap::columns = 354 ); - my @msg = split( /\n/, wrap( '', '', $msg ) ); - for( @msg ) { - $kernel->post( $heap->{ 'ircobject' }->session_id(), "privmsg", $self->{ "channel" }, $_ ); + for my $chan (split( /,/, $self->{ "channel" } ) ) { + $kernel->yield( "send_public_to", $msg, $chan ); } - print( "IRC : =>".$self-{ "channel" }.": $msg\n" ); } sub send_public_to {