forked from mirror/pixelfed
Update Api
This commit is contained in:
parent
a6d48dc19f
commit
605774cad4
2 changed files with 6 additions and 1 deletions
|
@ -72,6 +72,9 @@ class PublicApiController extends Controller
|
||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
$profile = Auth::user()->profile;
|
$profile = Auth::user()->profile;
|
||||||
|
if($profile->status) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
$shares = $status->sharedBy()->orderBy('created_at','desc')->paginate(10);
|
$shares = $status->sharedBy()->orderBy('created_at','desc')->paginate(10);
|
||||||
$collection = new Fractal\Resource\Collection($shares, new AccountTransformer());
|
$collection = new Fractal\Resource\Collection($shares, new AccountTransformer());
|
||||||
return $this->fractal->createData($collection)->toArray();
|
return $this->fractal->createData($collection)->toArray();
|
||||||
|
@ -112,6 +115,7 @@ class PublicApiController extends Controller
|
||||||
if($request->filled('min_id') || $request->filled('max_id')) {
|
if($request->filled('min_id') || $request->filled('max_id')) {
|
||||||
if($request->filled('min_id')) {
|
if($request->filled('min_id')) {
|
||||||
$replies = $status->comments()
|
$replies = $status->comments()
|
||||||
|
->whereNull('reblog_of_id')
|
||||||
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
|
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
|
||||||
->where('id', '>=', $request->min_id)
|
->where('id', '>=', $request->min_id)
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
|
@ -119,6 +123,7 @@ class PublicApiController extends Controller
|
||||||
}
|
}
|
||||||
if($request->filled('max_id')) {
|
if($request->filled('max_id')) {
|
||||||
$replies = $status->comments()
|
$replies = $status->comments()
|
||||||
|
->whereNull('reblog_of_id')
|
||||||
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
|
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
|
||||||
->where('id', '<=', $request->max_id)
|
->where('id', '<=', $request->max_id)
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
|
|
|
@ -328,7 +328,7 @@ class Inbox
|
||||||
$parent = Helpers::statusFirstOrFetch($obj['object']);
|
$parent = Helpers::statusFirstOrFetch($obj['object']);
|
||||||
$status = Status::whereProfileId($profile->id)
|
$status = Status::whereProfileId($profile->id)
|
||||||
->whereReblogOfId($parent->id)
|
->whereReblogOfId($parent->id)
|
||||||
->first();
|
->firstOrFail();
|
||||||
Notification::whereProfileId($parent->profile->id)
|
Notification::whereProfileId($parent->profile->id)
|
||||||
->whereActorId($profile->id)
|
->whereActorId($profile->id)
|
||||||
->whereAction('share')
|
->whereAction('share')
|
||||||
|
|
Loading…
Reference in a new issue