$self->{ "nick" } = "Destult";
$self->{ "port" } = 6667;
$self->{ "password" } = "";
- while( shift ) {
+ $self->{ "trap" } = 0;
+ while( $_ = shift ) {
+ print( "IRC : Parsing Option '$_'\n" );
my( $name, $value ) = split( /=/, $_, 2 );
if( exists( $self->{ $name } ) ) {
+ print( "IRC : Setting $name to $value\n" );
$self->{ $name } = $value;
}
}
# Strip color
$msg =~ s/(\x3)[0-9]{0,2}//g;
$msg =~ s/\x02//g;
+ if( $msg =~ m!(http://[^[:space:]]+)!i && $self->{ "trap" } == 1 ) {
+ print( "IRC : URL Trapped: '$1' from $who\n" );
+ my $url = $1;
+ $kernel->post( "core", "cmd", $who, "TINYURL $url", $self->{ "ssid" }, $dest->[0], "send_public_to" );
+ }
$cmd = ( split( / /, $msg, 2 ) )[0];
$kernel->post( "core", "seen", $who, $msg, $self->{ "ssid" }, $who, "send_private" );
if( $cmd =~ /^[~].*/ ) {