about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-08 20:22:54 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-03-08 20:22:54 +0100
commit1fbd1fa5c4ad5fcfef8af0c76f04e06f39aadd33 (patch)
tree1647c091e5d45d1d8dc20e6b25b3a588c2f8aa1b /app/models/status.rb
parentf03148f441d8dfc1856451c4faa00b5e26b6e199 (diff)
parent8f6c67bfdeddd1c2c1085067e3dc549fb53f6ff4 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/settings/preferences_controller.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/lib/user_settings_decorator.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/models/status.rb`:
  Conflict because of slight change in how glitch-soc handles the scope to
  filter out local-only posts for anonymous viewers.
  Took upstream's changes and re-applied glitch-soc's change.
- `app/models/user.rb`:
  Conflicts due to us having more user settings and upstream dropping
  `hide_network` (to replace it with an account attribute, properly migrated).
  Dropped `hide_network` like upstream.
- `app/views/directories/index.html.haml`:
  Conflict because upstream redesigned that page while glitch-soc had a minor
  change to support hiding the number of followers.
  Ported glitch-soc's change on top of upstream's redesign.

Additional changes:
- `app/models/account_statuses_filter.rb`:
  See change to `app/models/status.rb`.
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 06141f410..6a848baee 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -399,28 +399,6 @@ class Status < ApplicationRecord
       end
     end
 
-    def permitted_for(target_account, account)
-      visibility = [:public, :unlisted]
-
-      if account.nil?
-        where(visibility: visibility).not_local_only
-      elsif target_account.blocking?(account) || (account.domain.present? && target_account.domain_blocking?(account.domain)) # get rid of blocked peeps
-        none
-      elsif account.id == target_account.id # author can see own stuff
-        all
-      else
-        # followers can see followers-only stuff, but also things they are mentioned in.
-        # non-followers can see everything that isn't private/direct, but can see stuff they are mentioned in.
-        visibility.push(:private) if account.following?(target_account)
-
-        scope = left_outer_joins(:reblog)
-
-        scope.where(visibility: visibility)
-             .or(scope.where(id: account.mentions.select(:status_id)))
-             .merge(scope.where(reblog_of_id: nil).or(scope.where.not(reblogs_statuses: { account_id: account.excluded_from_timeline_account_ids })))
-      end
-    end
-
     def from_text(text)
       return [] if text.blank?