User: remove legacy public_level / is_public field

This commit is contained in:
Derf Null 2023-06-23 22:43:41 +02:00
parent c32b93ff4d
commit c5957fbdfd
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
5 changed files with 9 additions and 11 deletions

View file

@ -183,9 +183,9 @@ sub profile {
'profile',
name => $name,
uid => $user->{id},
privacy => $user,
bio => $profile->{bio}{html},
metadata => $profile->{metadata},
public_level => $user->{public_level},
is_self => $is_self,
following => ( $relation and $relation eq 'follows' ) ? 1 : 0,
follow_requested => ( $relation and $relation eq 'requests_follow' )
@ -533,7 +533,7 @@ sub user_status {
any => {
template => 'user_status',
name => $name,
public_level => $user->{public_level},
privacy => $user,
journey => $status,
journey_visibility => $visibility,
twitter => \%tw_data,
@ -615,7 +615,7 @@ sub status_card {
$self->render(
'_public_status_card',
name => $name,
public_level => $user->{public_level},
privacy => $user,
journey => $status,
journey_visibility => $visibility,
from_profile => $self->param('profile') ? 1 : 0,

View file

@ -186,10 +186,9 @@ sub get_privacy_by {
if ( my $user = $res->hash ) {
return {
id => $user->{id},
name => $user->{name},
public_level => $user->{public_level}, # todo remove?
default_visibility => $user->{public_level} & 0x7f,
id => $user->{id},
name => $user->{name},
default_visibility => $user->{public_level} & 0x7f,
default_visibility_str =>
$visibility_itoa{ $user->{public_level} & 0x7f },
comments_visible => $user->{public_level} & 0x80 ? 1 : 0,
@ -414,7 +413,6 @@ sub get {
notifications => $user->{notifications},
accept_follows => $user->{accept_follows} == 2 ? 1 : 0,
accept_follow_requests => $user->{accept_follows} == 1 ? 1 : 0,
is_public => $user->{public_level},
default_visibility => $user->{public_level} & 0x7f,
default_visibility_str =>
$visibility_itoa{ $user->{public_level} & 0x7f },

View file

@ -14,7 +14,7 @@
<i class="material-icons right"><%= visibility_icon($journey_visibility) %></i>
% }
</span>
% if ($public_level & 0x04 and $journey->{comment}) {
% if ($privacy->{comments_visible} and $journey->{comment}) {
<p>„<%= $journey->{comment} %>“</p>
% }
<p>

View file

@ -79,7 +79,7 @@
</div>
<div class="row">
<div class="col s12 publicstatuscol" data-user="<%= $name %>" data-profile="1">
%= include '_public_status_card', name => $name, public_level => $public_level, journey => $journey, journey_visibility => $journey_visibility, from_profile => 1
%= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, journey_visibility => $journey_visibility, from_profile => 1
</div>
</div>
% if ($journeys and @{$journeys}) {

View file

@ -1,6 +1,6 @@
<div class="row">
<div class="col s12 publicstatuscol" data-user="<%= $name %>">
%= include '_public_status_card', name => $name, public_level => $public_level, journey => $journey, journey_visibility => $journey_visibility
%= include '_public_status_card', name => $name, privacy => $privacy, journey => $journey, journey_visibility => $journey_visibility
</div>
</div>