diff options
author | Derf Null <derf@finalrewind.org> | 2023-07-03 18:12:34 +0200 |
---|---|---|
committer | Derf Null <derf@finalrewind.org> | 2023-07-03 18:12:34 +0200 |
commit | c9bae6fcee739e057f95512f9a3d56afcfaf84e8 (patch) | |
tree | f80a5ce6cbf775f58db77b43ad55af6712dda27d /lib | |
parent | a608ca6781c50ac170d347663a531850ab922cb0 (diff) |
journeys: simplify visibily check
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx/Controller/Profile.pm | 15 | ||||
-rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 13 |
2 files changed, 1 insertions, 27 deletions
diff --git a/lib/Travelynx/Controller/Profile.pm b/lib/Travelynx/Controller/Profile.pm index 0e03423..b8812f8 100755 --- a/lib/Travelynx/Controller/Profile.pm +++ b/lib/Travelynx/Controller/Profile.pm @@ -134,21 +134,6 @@ sub profile { $opt{after} = $now->clone->subtract( weeks => 4 ); } - if ( - $user->{default_visibility_str} eq 'public' - or ( $user->{default_visibility_str} eq 'travelynx' - and ( $my_user or $is_self ) ) - or ( $user->{default_visibility_str} eq 'followers' - and $relation - and $relation eq 'follows' ) - ) - { - $opt{with_default_visibility} = 1; - } - else { - $opt{with_default_visibility} = 0; - } - if ($is_self) { $opt{min_visibility} = 'followers'; } diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index aaaa9be..a811a7c 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -562,18 +562,7 @@ sub get { if ( $visibility_atoi{ $opt{min_visibility} } ) { $opt{min_visibility} = $visibility_atoi{ $opt{min_visibility} }; } - if ( $opt{with_default_visibility} ) { - $where{visibility} = [ - -or => { '=', undef }, - { '>=', $opt{min_visibility} } - ]; - } - else { - $where{visibility} = [ - -and => { '!=', undef }, - { '>=', $opt{min_visibility} } - ]; - } + $where{effective_visibility} = { '>=', $opt{min_visibility} }; } my @travels; |