Channel separator is now comma; rewrite send_public to delegate to send_public_to
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 12 Sep 2007 22:02:16 +0000 (22:02 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 12 Sep 2007 22:02:16 +0000 (22:02 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@30 088b83a4-0077-4247-935c-42ec02c2848b

irc.pl

diff --git a/irc.pl b/irc.pl
index 7ec6020..7283010 100644 (file)
--- 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 {