summaryrefslogtreecommitdiff
path: root/cgi/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-06-21 12:19:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-06-21 12:19:53 +0200
commita750d073f232e4728a7f426e4e77ca82e53059a0 (patch)
tree90e939c983c62c7e968d6808e9a5178447ac25ca /cgi/index.pl
parent168658c422f793e8a6b7bd53bfce748c9954094d (diff)
IRIS backend: proper delay / qos message support
Diffstat (limited to 'cgi/index.pl')
-rw-r--r--cgi/index.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index 6948855..8558ec3 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -119,14 +119,20 @@ sub handle_request {
}
my $info;
if ( $backend eq 'iris' ) {
- $info = join( ' +++ ', $result->info );
+ my $delaymsg
+ = join( ', ', map { $_->[1] } $result->delay_messages );
+ my $qosmsg = join( ' +++ ', map { $_->[1] } $result->qos_messages );
if ( $result->is_cancelled ) {
- $info = "Fahrt fällt aus: ${info}";
+ $info = "Fahrt fällt aus: ${delaymsg}";
}
- if ( $result->delay > 0 ) {
+ elsif ( $result->delay and $result->delay > 0 ) {
$info = sprintf( 'Verspätung ca %d Min.%s%s',
- $result->delay, $info ? q{: } : q{}, $info );
+ $result->delay, $delaymsg ? q{: } : q{}, $delaymsg );
}
+ if ( $info and $qosmsg ) {
+ $info .= ' +++ ';
+ }
+ $info .= $qosmsg;
}
else {
$info = $result->info;