summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm13
-rwxr-xr-xlib/Travelynx/Controller/Profile.pm5
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 5ae7a9f..2b51921 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1695,7 +1695,9 @@ sub startup {
$self->helper(
'get_user_status_json_v1' => sub {
my ( $self, %opt ) = @_;
- my $uid = $opt{uid};
+ my $uid = $opt{uid};
+ my $privacy = $opt{privacy}
+ // $self->users->get_privacy_by( uid => $uid );
my $status = $opt{status} // $self->get_user_status($uid);
my $ret = {
@@ -1737,6 +1739,15 @@ sub startup {
id => $status->{train_id},
},
intermediateStops => [],
+ visibility => {
+ level => $status->{visibility}
+ // $privacy->{default_visibility},
+ desc => (
+ $status->{visibility_str} eq 'default'
+ ? $privacy->{default_visibility_str}
+ : $status->{visibility_str}
+ ),
+ }
};
if ( not $opt{public} ) {
diff --git a/lib/Travelynx/Controller/Profile.pm b/lib/Travelynx/Controller/Profile.pm
index 6754159..925a1ff 100755
--- a/lib/Travelynx/Controller/Profile.pm
+++ b/lib/Travelynx/Controller/Profile.pm
@@ -410,8 +410,9 @@ sub user_status {
json => {
name => $name,
status => $self->get_user_status_json_v1(
- status => $status,
- public => 1
+ status => $status,
+ privacy => $user,
+ public => 1
),
version => $self->app->config->{version} // 'UNKNOWN',
},