summaryrefslogtreecommitdiff
path: root/xdcc.pl
diff options
context:
space:
mode:
authorJules <jules@asdf.us>2015-01-21 00:55:56 -0500
committerJules <jules@asdf.us>2015-01-21 00:55:56 -0500
commitc43f7b930ff42be266c41a5079dff6df0c6aff40 (patch)
tree4aa05b19a63904639421c1be2ef5d1037cd29f00 /xdcc.pl
parent62d216858f491b6b988c237f105be6e93f5f14d1 (diff)
xdcc info
Diffstat (limited to 'xdcc.pl')
-rw-r--r--xdcc.pl14
1 files 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},
}
}