From 86562f426d068b48849d0d268df179b46ed1a030 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 2 Jun 2019 17:54:06 +0200 Subject: Show HAFAS HIM messages in moreinfo --- lib/DBInfoscreen/Controller/Stationboard.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 758d370..5db9bbd 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -148,7 +148,7 @@ sub hafas_xml_req { # is invalid HTML, but present # regardless. As it is the last tag, we just throw it away. - $body =~ s{}s; + $body =~ s{]*/>}{}s; my $tree; @@ -958,6 +958,17 @@ sub handle_request { } } } + if ( $him and @{$him} ) { + $departures[-1]{messages}{him} = $him; + for my $message ( @{$him} ) { + if ( $message->{display} ) { + unshift( + @{ $departures[-1]{moreinfo} }, + [ $message->{header}, $message->{lead} ] + ); + } + } + } } } else { -- cgit v1.2.3