diff --git a/CHANGELOG.md b/CHANGELOG.md index 3121245d5..7660b396c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,6 +101,7 @@ - Updated NotificationCard component, fix default value. ([78ad4e77](https://github.com/pixelfed/pixelfed/commit/78ad4e77)) - Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa)) - Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d)) +- Updated liked by, fix remote username urls. ([f767d99a](https://github.com/pixelfed/pixelfed/commit/f767d99a)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 707434661..afeffa125 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -199,8 +199,15 @@ class PublicApiController extends Controller public function statusLikes(Request $request, $username, $id) { + abort_if(!$request->user(), 404); $status = Status::findOrFail($id); $this->scopeCheck($status->profile, $status); + $page = $request->input('page'); + if($page && $page >= 3 && $request->user()->profile_id != $status->profile_id) { + return response()->json([ + 'data' => [] + ]); + } $likes = $this->getLikes($status); return response()->json([ 'data' => $likes @@ -209,9 +216,16 @@ class PublicApiController extends Controller public function statusShares(Request $request, $username, $id) { + abort_if(!$request->user(), 404); $profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail(); $status = Status::whereProfileId($profile->id)->findOrFail($id); $this->scopeCheck($profile, $status); + $page = $request->input('page'); + if($page && $page >= 3 && $request->user()->profile_id != $status->profile_id) { + return response()->json([ + 'data' => [] + ]); + } $shares = $this->getShares($status); return response()->json([ 'data' => $shares diff --git a/app/Services/LikeService.php b/app/Services/LikeService.php index cb41850e1..063266642 100644 --- a/app/Services/LikeService.php +++ b/app/Services/LikeService.php @@ -71,13 +71,16 @@ class LikeService { $id = $like->profile_id; + $profile = ProfileService::get($id); + $profileUrl = $profile['local'] ? $profile['url'] : '/i/web/profile/_/' . $profile['id']; $res = [ - 'username' => ProfileService::get($id)['username'], - 'others' => $status->likes_count >= 5, + 'username' => $profile['username'], + 'url' => $profileUrl, + 'others' => $status->likes_count >= 3, ]; if(request()->user() && request()->user()->profile_id == $status->profile_id) { - $res['total_count'] = $status->likes_count; + $res['total_count'] = ($status->likes_count - 1); $res['total_count_pretty'] = number_format($res['total_count']); } diff --git a/public/js/network-timeline.js b/public/js/network-timeline.js index 57fabaf45..4a3b922bc 100644 Binary files a/public/js/network-timeline.js and b/public/js/network-timeline.js differ diff --git a/public/js/status.js b/public/js/status.js index c17f3010e..36c4e6657 100644 Binary files a/public/js/status.js and b/public/js/status.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index 7ad6a7390..9f39c8d87 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e6e2f8020..6e2012fa6 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 61762bac7..3c8076031 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -223,7 +223,7 @@