diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 3f8025a..569b65f 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1272,8 +1272,18 @@ sub startup { arr_ds100 => $in_transit->{arr_ds100}, arr_name => $in_transit->{arr_name}, route_after => \@route_after, + messages => $in_transit->{messages} + ? [ split( qr{[|]}, $in_transit->{messages} ) ] + : undef, }; + my @parsed_messages; + for my $message ( @{ $ret->{messages} // [] } ) { + my ( $ts, $msg ) = split( qr{:}, $message ); + push( @parsed_messages, [ epoch_to_dt($ts), $msg ] ); + } + $ret->{messages} = [ reverse @parsed_messages ]; + $ret->{departure_countdown} = $ret->{real_departure}->epoch - $now->epoch; if ( $in_transit->{real_arr_ts} ) { |