Let shorten pick the default for the default case
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 25 Aug 2008 16:36:59 +0000 (16:36 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 25 Aug 2008 16:36:59 +0000 (16:36 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@53 088b83a4-0077-4247-935c-42ec02c2848b

irc.pl

diff --git a/irc.pl b/irc.pl
index a20cc26..a1cf78b 100644 (file)
--- 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" );
+               }
        }
 }