summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-03-04 09:03:50 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-03-04 09:03:50 +0100
commite1231b88e2dd989dea0ce97d2b28d7e895cbfeaa (patch)
tree0d08bdf243f85b0efbaab23aebfeb988559672ec /lib/Travelynx/Controller
parent9abdaefaf59a4edc169419fb66bec237a29b9189 (diff)
status/profile: re-add ability to show latest checkout, if desired1.30.1
got lost in 1.30.0
Diffstat (limited to 'lib/Travelynx/Controller')
-rw-r--r--lib/Travelynx/Controller/Account.pm4
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm27
2 files changed, 27 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm
index e8bfcaf..4836117 100644
--- a/lib/Travelynx/Controller/Account.pm
+++ b/lib/Travelynx/Controller/Account.pm
@@ -463,7 +463,8 @@ sub privacy {
$opt{comments_visible} = $self->param('public_comment') ? 1 : 0;
- $opt{past_all} = $self->param('history_age') eq 'infinite' ? 1 : 0;
+ $opt{past_all} = $self->param('history_age') eq 'infinite' ? 1 : 0;
+ $opt{past_status} = $self->param('past_status') ? 1 : 0;
if ( $self->param('history_level') eq 'intern' ) {
$opt{past_visible} = 1;
@@ -493,6 +494,7 @@ sub privacy {
: 'private'
);
$self->param( history_age => $user->{past_all} ? 'infinite' : 'month' );
+ $self->param( past_status => $user->{past_status} );
$self->render( 'privacy', name => $user->{name} );
}
}
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index 8cf1722..80768ce 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -570,7 +570,7 @@ sub user_status {
);
my $visibility;
- if ( $status->{checked_in} ) {
+ if ( $status->{checked_in} or $status->{arr_name} ) {
$visibility
= $self->compute_effective_visibility(
$user->{default_visibility_str},
@@ -589,8 +589,15 @@ sub user_status {
)
{
$status->{checked_in} = 0;
+ $status->{arr_name} = undef;
}
}
+ if ( not $status->{checked_in}
+ and $status->{arr_name}
+ and not $user->{past_status} )
+ {
+ $status->{arr_name} = undef;
+ }
if ( $status->{checked_in} ) {
$og_data{url} .= '/' . $status->{sched_departure}->epoch;
@@ -640,7 +647,7 @@ sub public_profile {
my $status = $self->get_user_status( $user->{id} );
my $visibility;
- if ( $status->{checked_in} ) {
+ if ( $status->{checked_in} or $status->{arr_name} ) {
$visibility
= $self->compute_effective_visibility(
$user->{default_visibility_str},
@@ -659,8 +666,15 @@ sub public_profile {
)
{
$status->{checked_in} = 0;
+ $status->{arr_name} = undef;
}
}
+ if ( not $status->{checked_in}
+ and $status->{arr_name}
+ and not $user->{past_status} )
+ {
+ $status->{arr_name} = undef;
+ }
my %opt = (
uid => $user->{id},
@@ -855,7 +869,7 @@ sub public_status_card {
my $status = $self->get_user_status( $user->{id} );
my $visibility;
- if ( $status->{checked_in} ) {
+ if ( $status->{checked_in} or $status->{arr_name} ) {
$visibility
= $self->compute_effective_visibility(
$user->{default_visibility_str},
@@ -874,8 +888,15 @@ sub public_status_card {
)
{
$status->{checked_in} = 0;
+ $status->{arr_name} = undef;
}
}
+ if ( not $status->{checked_in}
+ and $status->{arr_name}
+ and not $user->{past_status} )
+ {
+ $status->{arr_name} = undef;
+ }
$self->render(
'_public_status_card',