Loading lib/Travelynx.pm +3 −1 Original line number Diff line number Diff line Loading @@ -1609,7 +1609,7 @@ sub startup { my ( $latest, $latest_cancellation ) = $self->journeys->get_latest( uid => $uid, db => $db db => $db, ); if ( $latest_cancellation and $latest_cancellation->{cancelled} ) { Loading Loading @@ -1675,6 +1675,8 @@ sub startup { arr_name => $latest->{arr_name}, arr_platform => $latest->{arr_platform}, comment => $latest->{user_data}{comment}, visibility => $latest->{visibility}, visibility_str => $latest->{visibility_str}, }; } Loading lib/Travelynx/Controller/Account.pm +3 −1 Original line number Diff line number Diff line Loading @@ -464,6 +464,7 @@ sub privacy { $opt{comments_visible} = $self->param('public_comment') ? 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; Loading Loading @@ -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} ); } } Loading lib/Travelynx/Controller/Traveling.pm +24 −3 Original line number Diff line number Diff line Loading @@ -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}, Loading @@ -589,7 +589,14 @@ 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} ) { Loading Loading @@ -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}, Loading @@ -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}, Loading Loading @@ -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}, Loading @@ -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', Loading lib/Travelynx/Model/Journeys.pm +10 −0 Original line number Diff line number Diff line Loading @@ -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', '*', Loading @@ -732,6 +737,11 @@ sub get_latest { } )->expand->hash; $latest->{visibility_str} = $latest->{visibility} ? $visibility_itoa{ $latest->{visibility} } : 'default'; return ( $latest_successful, $latest ); } Loading lib/Travelynx/Model/Users.pm +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 } ); Loading Loading @@ -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] Loading Loading
lib/Travelynx.pm +3 −1 Original line number Diff line number Diff line Loading @@ -1609,7 +1609,7 @@ sub startup { my ( $latest, $latest_cancellation ) = $self->journeys->get_latest( uid => $uid, db => $db db => $db, ); if ( $latest_cancellation and $latest_cancellation->{cancelled} ) { Loading Loading @@ -1675,6 +1675,8 @@ sub startup { arr_name => $latest->{arr_name}, arr_platform => $latest->{arr_platform}, comment => $latest->{user_data}{comment}, visibility => $latest->{visibility}, visibility_str => $latest->{visibility_str}, }; } Loading
lib/Travelynx/Controller/Account.pm +3 −1 Original line number Diff line number Diff line Loading @@ -464,6 +464,7 @@ sub privacy { $opt{comments_visible} = $self->param('public_comment') ? 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; Loading Loading @@ -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} ); } } Loading
lib/Travelynx/Controller/Traveling.pm +24 −3 Original line number Diff line number Diff line Loading @@ -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}, Loading @@ -589,7 +589,14 @@ 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} ) { Loading Loading @@ -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}, Loading @@ -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}, Loading Loading @@ -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}, Loading @@ -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', Loading
lib/Travelynx/Model/Journeys.pm +10 −0 Original line number Diff line number Diff line Loading @@ -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', '*', Loading @@ -732,6 +737,11 @@ sub get_latest { } )->expand->hash; $latest->{visibility_str} = $latest->{visibility} ? $visibility_itoa{ $latest->{visibility} } : 'default'; return ( $latest_successful, $latest ); } Loading
lib/Travelynx/Model/Users.pm +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 } ); Loading Loading @@ -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] Loading