allow self & signed-in local followers to see account when `hide public profile` is set

staging
multiple creatures 2019-07-21 21:16:15 -05:00
parent 47d9a34401
commit acc1fb81fe
1 changed files with 6 additions and 1 deletions

View File

@ -11,7 +11,12 @@ class AccountsController < ApplicationController
respond_to do |format|
format.html do
use_pack 'public'
not_found if @account.hidden || (@account&.user && @account.user.hides_public_profile?)
unless current_account && current_account.id == @account.id
not_found if @account.hidden
if @account&.user && @account.user.hides_public_profile?
not_found unless current_account && current_account.following?(@account))
end
end
mark_cacheable! unless user_signed_in?
@body_classes = 'with-modals'