mirror of
https://github.com/derf/travelynx
synced 2024-11-10 06:54:17 +00:00
/status/:user: respond to JSON
This commit is contained in:
parent
dbc5c38968
commit
9b83e1a8f1
2 changed files with 19 additions and 10 deletions
|
@ -1696,7 +1696,7 @@ sub startup {
|
|||
'get_user_status_json_v1' => sub {
|
||||
my ( $self, %opt ) = @_;
|
||||
my $uid = $opt{uid};
|
||||
my $status = $self->get_user_status($uid);
|
||||
my $status = $opt{status} // $self->get_user_status($uid);
|
||||
|
||||
my $ret = {
|
||||
deprecated => \0,
|
||||
|
|
|
@ -405,15 +405,24 @@ sub user_status {
|
|||
$og_data{description} = $tw_data{description} = q{};
|
||||
}
|
||||
|
||||
$self->render(
|
||||
'user_status',
|
||||
name => $name,
|
||||
public_level => $user->{public_level},
|
||||
journey => $status,
|
||||
journey_visibility => $visibility,
|
||||
twitter => \%tw_data,
|
||||
opengraph => \%og_data,
|
||||
version => $self->app->config->{version} // 'UNKNOWN',
|
||||
$self->respond_to(
|
||||
json => {
|
||||
json => {
|
||||
name => $name,
|
||||
status => $self->get_user_status_json_v1( status => $status ),
|
||||
version => $self->app->config->{version} // 'UNKNOWN',
|
||||
},
|
||||
},
|
||||
any => {
|
||||
template => 'user_status',
|
||||
name => $name,
|
||||
public_level => $user->{public_level},
|
||||
journey => $status,
|
||||
journey_visibility => $visibility,
|
||||
twitter => \%tw_data,
|
||||
opengraph => \%og_data,
|
||||
version => $self->app->config->{version} // 'UNKNOWN',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue