summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-24 14:58:08 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-24 14:58:08 +0200
commitaa0f9fdeeacf87fcba54f4afa6c3cbf5cf80c43e (patch)
treef936495707fd84e7be92c36b899ca892d0e0632d /lib/Travelynx.pm
parent501038ce110e5bc06e1144b221bbe99d45a754a0 (diff)
show recent delay/qos messages in checked_in view0.16
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm10
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} ) {