diff options
Diffstat (limited to 'lib/Travelynx/Controller')
-rw-r--r-- | lib/Travelynx/Controller/Account.pm | 23 | ||||
-rwxr-xr-x | lib/Travelynx/Controller/Profile.pm | 9 |
2 files changed, 14 insertions, 18 deletions
diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 80914fb..bc24c05 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -456,8 +456,7 @@ sub do_logout { sub privacy { my ($self) = @_; - my $user = $self->current_user; - my $public_level = $user->{is_public}; + my $user = $self->current_user; if ( $self->param('action') and $self->param('action') eq 'save' ) { my %opt; @@ -467,21 +466,16 @@ sub privacy { $opt{default_visibility} = $default_visibility; } + my $past_visibility = $visibility_atoi{ $self->param('history_level') }; + if ( defined $past_visibility ) { + $opt{past_visibility} = $past_visibility; + } + $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; - } - elsif ( $self->param('history_level') eq 'extern' ) { - $opt{past_visible} = 2; - } - else { - $opt{past_visible} = 0; - } - $self->users->set_privacy( uid => $user->{id}, %opt @@ -495,10 +489,7 @@ sub privacy { status_level => $visibility_itoa{ $user->{default_visibility} } ); $self->param( public_comment => $user->{comments_visible} ); $self->param( - history_level => $user->{past_visible} & 0x01 ? 'intern' - : $user->{past_visible} & 0x02 ? 'extern' - : 'private' - ); + history_level => $visibility_itoa{ $user->{past_visibility} } ); $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/Profile.pm b/lib/Travelynx/Controller/Profile.pm index 005a811..d77e6f7 100755 --- a/lib/Travelynx/Controller/Profile.pm +++ b/lib/Travelynx/Controller/Profile.pm @@ -134,8 +134,13 @@ sub profile { my @journeys; - if ( $user->{past_visible} == 2 - or ( $user->{past_visible} == 1 and ( $my_user or $is_self ) ) ) + if ( + $user->{past_visibility_str} eq 'public' + or ( $user->{past_visibility_str} eq 'travelynx' + and ( $my_user or $is_self ) ) + or ( $user->{past_visibility_str} eq 'followers' + and ( ( $relation and $relation eq 'follows' ) or $is_self ) ) + ) { my %opt = ( |