diff options
author | Derf Null <derf@finalrewind.org> | 2023-05-24 21:41:51 +0200 |
---|---|---|
committer | Derf Null <derf@finalrewind.org> | 2023-05-24 21:41:51 +0200 |
commit | 7580497ceab15b80e9c6fcfd7b000a9e4d6fd0a7 (patch) | |
tree | 27145bea4c40f618c75ad97adca06e047a0a90c8 /lib/Travelynx.pm | |
parent | ac816c09b23233c9e3de0f1b12cc905a921ca85a (diff) |
get_user_status_json_v1: expose visibility
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 13 |
1 files changed, 12 insertions, 1 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} ) { |