my( $name, $value ) = split( /=/, $_, 2 );
if( $name == "trap" ) {
if( $value == 1 ) {
- $value = "TinyURL";
+ $value = "";
}
print( "IRC : Enabling URL trapping using $value\n" );
$self->{ "trap" } = $value;
} elsif( $msg =~ m!(https?://[^[:space:]]+)!i && $self->{ "trapEnabled" } == 1 && length($1) >= 30 ) {
print( "IRC : URL Trapped: '$1' from $who\n" );
my $url = $1;
- $kernel->post( "core", "cmd", $who, "SHORTEN ".$self->{ "trap" }." $url", $self->{ "ssid" }, $dest->[0], "send_public_to" );
+ if( $self->{ "trap" } ) {
+ $kernel->post( "core", "cmd", $who, "SHORTEN ".$self->{ "trap" }." $url", $self->{ "ssid" }, $dest->[0], "send_public_to" );
+ } else {
+ $kernel->post( "core", "cmd", $who, "SHORTEN $url", $self->{ "ssid" }, $dest->[0], "send_public_to" );
+ }
}
}