Skip to content

Commit

Permalink
fix last_active stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmay committed May 14, 2011
1 parent 75e2b86 commit f01a082
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/App/Termcast/Server/Telnet/Dispatcher/Connection.pm
@@ -1,10 +1,12 @@
package App::Termcast::Server::Telnet::Dispatcher::Connection;
use Moose;

use Time::Duration;

use constant CLEAR => "\e[2J\e[H";

has viewing => (
is => 'ro',
is => 'rw',
isa => 'Maybe[Str]',
clearer => '_clear_viewing',
);
Expand Down Expand Up @@ -96,8 +98,8 @@ sub send_connection_list {
foreach my $stream (@stream_data) {
$output .= sprintf "%s) %s - Active %s\r\n",
$letter,
$stream->{user},
ago(time() - $stream->{last_active});
$stream->username,
ago(time() - $stream->last_active->epoch);
$letter++;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/App/Termcast/Server/Telnet/Stream/Pool.pm
Expand Up @@ -11,7 +11,8 @@ has unix_streams => (
traits => ['Hash'],
handles => {
unix_stream_objects => 'values',
unix_stream_ids => 'keys'
unix_stream_ids => 'keys',
get_unix_stream => 'get',
},
default => sub { {} },
);
Expand Down

0 comments on commit f01a082

Please sign in to comment.