diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 7ab41a286..cbc120ced 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -186,66 +186,6 @@ class ProfileController extends Controller ->header('Content-Type', 'application/atom+xml'); } - public function followers(Request $request, $username) - { - $profile = $user = Profile::whereUsername($username)->firstOrFail(); - if($profile->status != null) { - return $this->accountCheck($profile); - } - // TODO: fix $profile/$user mismatch in profile & follower templates - $owner = Auth::check() && Auth::id() === $user->user_id; - $is_following = ($owner == false && Auth::check()) ? $user->followedBy(Auth::user()->profile) : false; - if($profile->is_private || Auth::check()) { - $blocked = $this->blockedProfileCheck($profile); - $check = $this->privateProfileCheck($profile, null); - if($check || $blocked) { - return view('profile.private', compact('user', 'is_following')); - } - } - $followers = $profile->followers()->whereNull('status')->orderBy('followers.created_at', 'desc')->simplePaginate(12); - $is_admin = is_null($user->domain) ? $user->user->is_admin : false; - if ($user->remote_url) { - $settings = new \StdClass; - $settings->crawlable = false; - } else { - $settings = $profile->user->settings; - if(!$settings->show_profile_follower_count && !$owner) { - abort(403); - } - } - return view('profile.followers', compact('user', 'profile', 'followers', 'owner', 'is_following', 'is_admin', 'settings')); - } - - public function following(Request $request, $username) - { - $profile = $user = Profile::whereUsername($username)->firstOrFail(); - if($profile->status != null) { - return $this->accountCheck($profile); - } - // TODO: fix $profile/$user mismatch in profile & follower templates - $owner = Auth::check() && Auth::id() === $user->user_id; - $is_following = ($owner == false && Auth::check()) ? $user->followedBy(Auth::user()->profile) : false; - if($profile->is_private || Auth::check()) { - $blocked = $this->blockedProfileCheck($profile); - $check = $this->privateProfileCheck($profile, null); - if($check || $blocked) { - return view('profile.private', compact('user', 'is_following')); - } - } - $following = $profile->following()->whereNull('status')->orderBy('followers.created_at', 'desc')->simplePaginate(12); - $is_admin = is_null($user->domain) ? $user->user->is_admin : false; - if ($user->remote_url) { - $settings = new \StdClass; - $settings->crawlable = false; - } else { - $settings = $profile->user->settings; - if(!$settings->show_profile_follower_count && !$owner) { - abort(403); - } - } - return view('profile.following', compact('user', 'profile', 'following', 'owner', 'is_following', 'is_admin', 'settings')); - } - public function meRedirect() { abort_if(!Auth::check(), 404); diff --git a/resources/views/profile/followers.blade.php b/resources/views/profile/followers.blade.php deleted file mode 100644 index aa6ef39aa..000000000 --- a/resources/views/profile/followers.blade.php +++ /dev/null @@ -1,66 +0,0 @@ -@extends('layouts.app',['title' => $profile->username . "’s followers"]) - -@section('content') - -@include('profile.partial.user-info') - -
-
- @if($followers->count() !== 0) - - @else -
-
-
-
-

{{ __('profile.emptyFollowers') }}

-
-
-
-
- @endif -
- {{$followers->links()}} -
-
-
-@endsection - -@push('meta') - - - -@endpush diff --git a/resources/views/profile/following.blade.php b/resources/views/profile/following.blade.php deleted file mode 100644 index 623accf6f..000000000 --- a/resources/views/profile/following.blade.php +++ /dev/null @@ -1,66 +0,0 @@ -@extends('layouts.app',['title' => $profile->username . "’s follows"]) - -@section('content') - -@include('profile.partial.user-info') - -
-
- @if($following->count() !== 0) - - @else -
-
-
-
-

{{ __('profile.emptyFollowing') }}

-
-
-
-
- @endif -
- {{$following->links()}} -
-
-
-@endsection - -@push('meta') - - - -@endpush diff --git a/routes/web.php b/routes/web.php index 0dd1b37fe..d4090361a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -341,7 +341,5 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::post('p/{username}/{id}/edit', 'StatusController@editStore'); Route::get('p/{username}/{id}.json', 'StatusController@showObject'); Route::get('p/{username}/{id}', 'StatusController@show'); - Route::get('{username}/followers', 'ProfileController@followers')->middleware('auth'); - Route::get('{username}/following', 'ProfileController@following')->middleware('auth'); Route::get('{username}', 'ProfileController@show'); });