Remove deprecated profile following/followers
This commit is contained in:
parent
3be6964ea9
commit
5e1295f18b
4 changed files with 0 additions and 194 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue