mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update ApiV1Controller, add bookmarked to timeline entities
This commit is contained in:
parent
526807f01c
commit
ca746717cb
1 changed files with 7 additions and 2 deletions
|
@ -2193,6 +2193,7 @@ class ApiV1Controller extends Controller
|
|||
if($pid) {
|
||||
$status['favourited'] = (bool) LikeService::liked($pid, $s['id']);
|
||||
$status['reblogged'] = (bool) ReblogService::get($pid, $status['id']);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($pid, $status['id']);
|
||||
}
|
||||
return $status;
|
||||
})
|
||||
|
@ -2203,6 +2204,7 @@ class ApiV1Controller extends Controller
|
|||
if(!empty($status['reblog'])) {
|
||||
$status['reblog']['favourited'] = (bool) LikeService::liked($pid, $status['reblog']['id']);
|
||||
$status['reblog']['reblogged'] = (bool) ReblogService::get($pid, $status['reblog']['id']);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($pid, $status['id']);
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
@ -2244,6 +2246,7 @@ class ApiV1Controller extends Controller
|
|||
if($pid) {
|
||||
$status['favourited'] = (bool) LikeService::liked($pid, $s['id']);
|
||||
$status['reblogged'] = (bool) ReblogService::get($pid, $status['id']);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($pid, $status['id']);
|
||||
}
|
||||
return $status;
|
||||
})
|
||||
|
@ -2254,6 +2257,7 @@ class ApiV1Controller extends Controller
|
|||
if(!empty($status['reblog'])) {
|
||||
$status['reblog']['favourited'] = (bool) LikeService::liked($pid, $status['reblog']['id']);
|
||||
$status['reblog']['reblogged'] = (bool) ReblogService::get($pid, $status['reblog']['id']);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($pid, $status['id']);
|
||||
}
|
||||
|
||||
return $status;
|
||||
|
@ -2378,6 +2382,7 @@ class ApiV1Controller extends Controller
|
|||
if($user) {
|
||||
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $k);
|
||||
$status['reblogged'] = (bool) ReblogService::get($user->profile_id, $status['id']);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($user->profile_id, $status['id']);
|
||||
}
|
||||
return $status;
|
||||
})
|
||||
|
@ -3615,8 +3620,8 @@ class ApiV1Controller extends Controller
|
|||
abort_if(!$request->user(), 403);
|
||||
|
||||
$pid = $request->user()->profile_id;
|
||||
$home = $request->input('home.last_read_id');
|
||||
$notifications = $request->input('notifications.last_read_id');
|
||||
$home = $request->input('home[last_read_id]');
|
||||
$notifications = $request->input('notifications[last_read_id]');
|
||||
|
||||
if($home) {
|
||||
return $this->json(MarkerService::set($pid, 'home', $home));
|
||||
|
|
Loading…
Reference in a new issue