diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-02-16 20:56:28 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-02-16 20:56:28 +0100 |
commit | 167b01fa4264a8193ff3cbd9d3f1741f5702235a (patch) | |
tree | 6b03555ced3c757269898f8f7ebf46506aa2b06a /lib/Travelynx.pm | |
parent | ef3252863e28905fe96a49a91e5a62c156c69e6e (diff) |
link traewelling profile from travelynx profile; show traewelling status
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 8e29114..40ca0a5 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1822,6 +1822,27 @@ sub startup { comment => $in_transit->{user_data}{comment}, }; + my $traewelling = $self->traewelling->get( + uid => $uid, + db => $db + ); + if ( $traewelling->{latest_run} + >= epoch_to_dt( $in_transit->{checkin_ts} ) ) + { + $ret->{traewelling} = $traewelling; + if ( @{ $traewelling->{data}{log} // [] } + and ( my $log_entry = $traewelling->{data}{log}[0] ) ) + { + if ( $log_entry->[2] ) { + $ret->{traewelling_status} = $log_entry->[2]; + $ret->{traewelling_url} + = 'https://traewelling.de/status/' + . $log_entry->[2]; + } + $ret->{traewelling_log_latest} = $log_entry->[1]; + } + } + my @parsed_messages; for my $message ( @{ $ret->{messages} // [] } ) { my ( $ts, $msg ) = @{$message}; |