X-Git-Url: http://git.vpit.fr/?p=perl%2Fscripts%2Fxchat.git;a=blobdiff_plain;f=Xchat%2FXPI%2FNet.pm;fp=Xchat%2FXPI%2FNet.pm;h=d4823a82b622e01037ed6c0374e8f69f3d1a5999;hp=96c4af30f71f4803986e8752adc3b4e0222ae828;hb=7e00cc69db0ee7a4379b5378f1673efc4b531ae8;hpb=edd1cbfd1a969e16d8df9988eb448a53c97c02e7 diff --git a/Xchat/XPI/Net.pm b/Xchat/XPI/Net.pm index 96c4af3..d4823a8 100644 --- a/Xchat/XPI/Net.pm +++ b/Xchat/XPI/Net.pm @@ -3,12 +3,15 @@ package Xchat::XPI::Net; use strict; use warnings; +use Xchat qw<:all>; + +use lib get_info 'xchatdir'; +use Xchat::XPI::Utils qw; + use IO::Socket::INET; use Net::DNS; -use Xchat qw<:all>; - our $VERSION = '0.03'; my $res; @@ -32,10 +35,12 @@ sub resolve { return unless $sock; $sock->autoflush(1); - return Xchat::hook_fd($sock, \&_dns_recv, { - flags => FD_READ, - data => [ $callback, $args ], - }); + return called_from_script { + Xchat::hook_fd($sock, \&_dns_recv, { + flags => FD_READ, + data => [ $callback, $args ], + }); + } } sub _dns_recv { @@ -107,10 +112,12 @@ sub whois { print $sock "$host\x0D\x0A"; $sock->shutdown(1); # stop writing - return Xchat::hook_fd($sock, \&_whois_recv, { - flags => FD_READ, - data => [ $callback, $args ], - }); + return called_from_script { + Xchat::hook_fd($sock, \&_whois_recv, { + flags => FD_READ, + data => [ $callback, $args ], + }); + } } sub _whois_recv {