diff options
-rw-r--r-- | app/controllers/statuses_controller.rb | 2 | ||||
-rw-r--r-- | app/models/status.rb | 4 | ||||
-rw-r--r-- | app/workers/activitypub/distribute_poll_update_worker.rb | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb index f95f1dfe0..00db6c169 100644 --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@ -47,7 +47,7 @@ class StatusesController < ApplicationController end def embed - raise ActiveRecord::RecordNotFound if @status.hidden? + raise ActiveRecord::RecordNotFound unless @status.distributable? expires_in 180, public: true response.headers['X-Frame-Options'] = 'ALLOWALL' diff --git a/app/models/status.rb b/app/models/status.rb index 067bdb72a..a1dc37fe8 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -250,10 +250,6 @@ class Status < ApplicationRecord end end - def hidden? - hidden || !distributable? - end - def distributable? public_visibility? || unlisted_visibility? || local_visibility? end diff --git a/app/workers/activitypub/distribute_poll_update_worker.rb b/app/workers/activitypub/distribute_poll_update_worker.rb index 57379768f..bbdee1286 100644 --- a/app/workers/activitypub/distribute_poll_update_worker.rb +++ b/app/workers/activitypub/distribute_poll_update_worker.rb @@ -10,7 +10,7 @@ class ActivityPub::DistributePollUpdateWorker @status = Status.find(status_id) @account = @status.account - return if @status.preloadable_poll.nil? || @status.local_only? + return if @status.preloadable_poll.nil? || @status.local_only? || @status.hidden ActivityPub::DeliveryWorker.push_bulk(inboxes) do |inbox_url| [payload, @account.id, inbox_url] |