diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-03-04 09:03:50 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-03-04 09:03:50 +0100 |
commit | e1231b88e2dd989dea0ce97d2b28d7e895cbfeaa (patch) | |
tree | 0d08bdf243f85b0efbaab23aebfeb988559672ec /lib/Travelynx/Model | |
parent | 9abdaefaf59a4edc169419fb66bec237a29b9189 (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/Model')
-rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 10 | ||||
-rw-r--r-- | lib/Travelynx/Model/Users.pm | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index 0062642..312910f 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -720,6 +720,11 @@ sub get_latest { } )->expand->hash; + $latest_successful->{visibility_str} + = $latest_successful->{visibility} + ? $visibility_itoa{ $latest_successful->{visibility} } + : 'default'; + my $latest = $db->select( 'journeys_str', '*', @@ -732,6 +737,11 @@ sub get_latest { } )->expand->hash; + $latest->{visibility_str} + = $latest->{visibility} + ? $visibility_itoa{ $latest->{visibility} } + : 'default'; + return ( $latest_successful, $latest ); } diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm index 397b618..1ffd7ab 100644 --- a/lib/Travelynx/Model/Users.pm +++ b/lib/Travelynx/Model/Users.pm @@ -178,6 +178,7 @@ sub get_privacy_by_name { comments_visible => $user->{public_level} & 0x80 ? 1 : 0, past_visible => ( $user->{public_level} & 0x300 ) >> 8, past_all => $user->{public_level} & 0x400 ? 1 : 0, + past_status => $user->{public_level} & 0x800 ? 1 : 0, }; } return; @@ -194,7 +195,7 @@ sub set_privacy { = ( $opt{default_visibility} & 0x7f ) | ( $opt{comments_visible} ? 0x80 : 0x00 ) | ( ( ( $opt{past_visible} // 0 ) << 8 ) & 0x300 ) - | ( $opt{past_all} ? 0x400 : 0 ); + | ( $opt{past_all} ? 0x400 : 0 ) | ( $opt{past_status} ? 0x800 : 0 ); } $db->update( 'users', { public_level => $public_level }, { id => $uid } ); @@ -376,6 +377,7 @@ sub get { comments_visible => $user->{public_level} & 0x80 ? 1 : 0, past_visible => ( $user->{public_level} & 0x300 ) >> 8, past_all => $user->{public_level} & 0x400 ? 1 : 0, + past_status => $user->{public_level} & 0x800 ? 1 : 0, email => $user->{email}, sb_name => $user->{external_services} ? $sb_templates[ $user->{external_services} & 0x07 ][0] |