From c43f7b930ff42be266c41a5079dff6df0c6aff40 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 21 Jan 2015 00:55:56 -0500 Subject: xdcc info --- xdcc.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xdcc.pl b/xdcc.pl index 9c8f496..718d21e 100644 --- a/xdcc.pl +++ b/xdcc.pl @@ -293,9 +293,9 @@ sub xdcc_describe { } sub xdcc_info_remote { my ($server, $nick, $index) = @_; - my $info = xdcc_get_info(index); + my $info = xdcc_get_info($index); if (! $info) { return; } - xdcc_message( $server, $nick, 'xdcc_stats', '#', $info->{id} ); + xdcc_message( $server, $nick, 'xdcc_stats', ' #', $info->{id} ); xdcc_message( $server, $nick, 'xdcc_stats', 'name', $info->{name} ); xdcc_message( $server, $nick, 'xdcc_stats', 'date', $info->{date} ); xdcc_message( $server, $nick, 'xdcc_stats', 'size', $info->{size} ); @@ -303,9 +303,9 @@ sub xdcc_info_remote { } sub xdcc_info { my ($index) = @_; - my $info = xdcc_get_info(index); + my $info = xdcc_get_info($index); if (! $info) { return; } - Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_stats', '#', $info->{id} ); + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_stats', ' #', $info->{id} ); Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_stats', 'name', $info->{name} ); Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_stats', 'date', $info->{date} ); Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'xdcc_stats', 'size', $info->{size} ); @@ -328,15 +328,15 @@ sub xdcc_get_info { my $bytes; if ($size < 1024) { $bytes = $size + " b." } - elsif ($size < 1024*1024) { $bytes = floor($size/1024) + " kb." } - elsif ($size < 1024*1024*1024) { $bytes = sprintf("%0.1d",floor((10*$size)/(1024*1024))) + " kb." } + elsif ($size < 1024*1024) { $bytes = int($size/1024) + " kb." } + elsif ($size < 1024*1024*1024) { $bytes = sprintf("%0.1d",int((10*$size)/(1024*1024))) + " kb." } return { id => $id+1, name => $file->{fn}, nick => $file->{nick}, date => $ymd, - size => $size, + size => $bytes, desc => $file->{desc}, } } -- cgit v1.2.3-70-g09d2