mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
move outbox filtering to Status#permitted_for (as per @ekiru)
This commit is contained in:
parent
3ec47e732b
commit
c5a4eda694
@ -4,7 +4,7 @@ class ActivityPub::OutboxesController < Api::BaseController
|
|||||||
before_action :set_account
|
before_action :set_account
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@statuses = @account.statuses.not_local_only.permitted_for(@account, current_account).paginate_by_max_id(20, params[:max_id], params[:since_id])
|
@statuses = @account.statuses.permitted_for(@account, current_account).paginate_by_max_id(20, params[:max_id], params[:since_id])
|
||||||
@statuses = cache_collection(@statuses, Status)
|
@statuses = cache_collection(@statuses, Status)
|
||||||
|
|
||||||
render json: outbox_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json'
|
render json: outbox_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json'
|
||||||
|
@ -223,7 +223,7 @@ class Status < ApplicationRecord
|
|||||||
visibility = [:public, :unlisted]
|
visibility = [:public, :unlisted]
|
||||||
|
|
||||||
if account.nil?
|
if account.nil?
|
||||||
where(visibility: visibility)
|
where(visibility: visibility).not_local_only
|
||||||
elsif target_account.blocking?(account) # get rid of blocked peeps
|
elsif target_account.blocking?(account) # get rid of blocked peeps
|
||||||
none
|
none
|
||||||
elsif account.id == target_account.id # author can see own stuff
|
elsif account.id == target_account.id # author can see own stuff
|
||||||
|
Loading…
Reference in New Issue
Block a user