mirror of
https://github.com/derf/travelynx
synced 2024-11-13 00:07:09 +00:00
get_user_status_json_v1: expose visibility
This commit is contained in:
parent
ac816c09b2
commit
7580497cea
2 changed files with 15 additions and 3 deletions
|
@ -1696,6 +1696,8 @@ sub startup {
|
||||||
'get_user_status_json_v1' => sub {
|
'get_user_status_json_v1' => sub {
|
||||||
my ( $self, %opt ) = @_;
|
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 $status = $opt{status} // $self->get_user_status($uid);
|
||||||
|
|
||||||
my $ret = {
|
my $ret = {
|
||||||
|
@ -1737,6 +1739,15 @@ sub startup {
|
||||||
id => $status->{train_id},
|
id => $status->{train_id},
|
||||||
},
|
},
|
||||||
intermediateStops => [],
|
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} ) {
|
if ( not $opt{public} ) {
|
||||||
|
|
|
@ -411,6 +411,7 @@ sub user_status {
|
||||||
name => $name,
|
name => $name,
|
||||||
status => $self->get_user_status_json_v1(
|
status => $self->get_user_status_json_v1(
|
||||||
status => $status,
|
status => $status,
|
||||||
|
privacy => $user,
|
||||||
public => 1
|
public => 1
|
||||||
),
|
),
|
||||||
version => $self->app->config->{version} // 'UNKNOWN',
|
version => $self->app->config->{version} // 'UNKNOWN',
|
||||||
|
|
Loading…
Reference in a new issue