summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Travelynx/Controller/Profile.pm6
-rw-r--r--lib/Travelynx/Model/Users.pm8
-rw-r--r--templates/_public_status_card.html.ep2
-rw-r--r--templates/profile.html.ep2
-rw-r--r--templates/user_status.html.ep2
5 files changed, 9 insertions, 11 deletions
diff --git a/lib/Travelynx/Controller/Profile.pm b/lib/Travelynx/Controller/Profile.pm
index 3923773..ff69c43 100755
--- a/lib/Travelynx/Controller/Profile.pm
+++ b/lib/Travelynx/Controller/Profile.pm
@@ -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,
diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm
index ade9711..809273f 100644
--- a/lib/Travelynx/Model/Users.pm
+++ b/lib/Travelynx/Model/Users.pm
@@ -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 },
diff --git a/templates/_public_status_card.html.ep b/templates/_public_status_card.html.ep
index 42d507e..65255c5 100644
--- a/templates/_public_status_card.html.ep
+++ b/templates/_public_status_card.html.ep
@@ -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>
diff --git a/templates/profile.html.ep b/templates/profile.html.ep
index 06f8cfe..ed7ff0d 100644
--- a/templates/profile.html.ep
+++ b/templates/profile.html.ep
@@ -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}) {
diff --git a/templates/user_status.html.ep b/templates/user_status.html.ep
index d67ffb0..97c10ec 100644
--- a/templates/user_status.html.ep
+++ b/templates/user_status.html.ep
@@ -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>