Skip to content

Commit

Permalink
Update PublicApiController
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Apr 1, 2019
1 parent 718d9a0 commit dbaf903
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/PublicApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function statusComments(Request $request, $username, int $postId)
]);
$limit = $request->limit ?? 10;
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
$status = Status::whereProfileId($profile->id)->findOrFail($postId);
$status = Status::whereProfileId($profile->id)->whereCommentsDisabled(false)->findOrFail($postId);
$this->scopeCheck($profile, $status);
if($request->filled('min_id') || $request->filled('max_id')) {
if($request->filled('min_id')) {
Expand Down Expand Up @@ -578,9 +578,9 @@ public function accountStatuses(Request $request, $id)
$following = Follower::whereProfileId($pid)->pluck('following_id');
return $following->push($pid)->toArray();
});
$visibility = true == in_array($profile->id, $following) ? ['public', 'unlisted', 'private'] : ['public'];
$visibility = true == in_array($profile->id, $following) ? ['public', 'unlisted', 'private'] : ['public', 'unlisted'];
} else {
$visibility = ['public'];
$visibility = ['public', 'unlisted'];
}
}

Expand All @@ -606,8 +606,8 @@ public function accountStatuses(Request $request, $id)
->whereLocal(true)
->whereNull('uri')
->where('id', $dir, $id)
->whereIn('visibility',$visibility)
->orderBy('created_at', 'desc')
->whereIn('visibility', $visibility)
->latest()
->limit($limit)
->get();

Expand Down

0 comments on commit dbaf903

Please sign in to comment.