From: pdbogen Date: Mon, 25 Aug 2008 16:36:59 +0000 (+0000) Subject: Let shorten pick the default for the default case X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=073e1532ecabd61157357230616242c4dcb72dca;p=destult.git Let shorten pick the default for the default case git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@53 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/irc.pl b/irc.pl index a20cc26..a1cf78b 100644 --- a/irc.pl +++ b/irc.pl @@ -40,7 +40,7 @@ sub new { 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; @@ -206,7 +206,11 @@ sub on_public { } 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" ); + } } }