about summary refs log tree commit diff
path: root/app/controllers/accounts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/accounts_controller.rb')
-rw-r--r--app/controllers/accounts_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index 94eef62e2..25a8e8e30 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -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'