From 073e1532ecabd61157357230616242c4dcb72dca Mon Sep 17 00:00:00 2001 From: pdbogen Date: Mon, 25 Aug 2008 16:36:59 +0000 Subject: [PATCH] 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 --- irc.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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" ); + } } } -- 2.11.0