From 3bdfdc74045b48937c446d96fc581931f544fc64 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 27 Dec 2025 19:06:50 +0100 Subject: checkin suggestions: respect "use_history" account configuration --- lib/Travelynx/Command/work.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx/Command/work.pm') diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index 35c90c2..d6e70ed 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -53,6 +53,9 @@ sub run { my $arr = $entry->{arr_eva}; my $train_id = $entry->{train_id}; + my $use_history = $self->app->users->use_history( uid => $uid ); + my $suggestions_enabled = $use_history & 0x02; + if ( $train_id eq 'manual' ) { if ( $arr and $entry->{real_arr_ts} @@ -201,7 +204,9 @@ sub run { uid => $uid )->wait; } - elsif ( $entry->{real_arr_ts} - $now->epoch < 900 ) { + elsif ( $suggestions_enabled + and $entry->{real_arr_ts} - $now->epoch < 900 ) + { my @destinations = $self->app->journeys->get_connection_targets( uid => $uid, @@ -332,7 +337,9 @@ sub run { uid => $uid )->wait; } - elsif ( $entry->{real_arr_ts} - $now->epoch < 900 ) { + elsif ( $suggestions_enabled + and $entry->{real_arr_ts} - $now->epoch < 900 ) + { my @destinations = $self->app->journeys->get_connection_targets( uid => $uid, -- cgit v1.2.3