summaryrefslogtreecommitdiffstats
path: root/modules/event.pl
diff options
context:
space:
mode:
Diffstat (limited to 'modules/event.pl')
-rw-r--r--modules/event.pl18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/event.pl b/modules/event.pl
index d3e3fa5..4978432 100644
--- a/modules/event.pl
+++ b/modules/event.pl
@@ -338,15 +338,15 @@ sub on_public
$::sc{lc $event->{to}->[0]}{users}{lc $event->{nick}}{msgtime} = time;
$::log->logg( $event );
$::db->logg( $event );
-# if ($event->{args}->[0] =~ /(https?:\/\/bitly.com\/\w+)|(https?:\/\/bit.ly\/\w+)|(https?:\/\/j.mp\/\w+)/i) {
-# my $reqid = $::async->add( HTTP::Request->new( GET => $1 ) );
-# $::httpRequests{$reqid} = $event;
-# my ($response, $id) = $::async->wait_for_next_response( 1 );
-# if (defined($response)) {
-# on_httpResponse($conn, $id, $response);
-# }
-# else { $conn->schedule( 1, sub { checkHTTP($conn); } ); }
-# }
+ if ($event->{args}->[0] =~ /(https?:\/\/bitly.com\/\w+|https?:\/\/bit.ly\/\w+|https?:\/\/j.mp\/\w+)/i) {
+ my $reqid = $::async->add( HTTP::Request->new( GET => $1 ) );
+ $::httpRequests{$reqid} = $event;
+ my ($response, $id) = $::async->wait_for_next_response( 1 );
+ if (defined($response)) {
+ on_httpResponse($conn, $id, $response);
+ }
+ else { $conn->schedule( 1, sub { checkHTTP($conn); } ); }
+ }
$::inspector->inspect( $conn, $event );
$::commander->command( $conn, $event );
}