Change: 時限投稿はフォロワー以外にはActivityを発行しない

This commit is contained in:
KMY 2023-11-07 18:38:37 +09:00
parent d7f07ae80f
commit 6bd730570e
2 changed files with 8 additions and 1 deletions

View file

@ -65,7 +65,7 @@ class StatusesController < ApplicationController
if request.authorization.present? && request.authorization.match(/^Bearer /i) if request.authorization.present? && request.authorization.match(/^Bearer /i)
raise Mastodon::NotPermittedError unless @status.capability_tokens.find_by(token: request.authorization.gsub(/^Bearer /i, '')) raise Mastodon::NotPermittedError unless @status.capability_tokens.find_by(token: request.authorization.gsub(/^Bearer /i, ''))
else else
authorize @status, :show? authorize @status, request.format == :json ? :show_activity? : :show?
end end
rescue Mastodon::NotPermittedError rescue Mastodon::NotPermittedError
not_found not_found

View file

@ -28,6 +28,13 @@ class StatusPolicy < ApplicationPolicy
owned? owned?
end end
def show_activity?
return false unless show?
return true if record.scheduled_expiration_status.blank?
following_author?
end
def reblog? def reblog?
!requires_mention? && (!private? || owned?) && show? && !blocking_author? !requires_mention? && (!private? || owned?) && show? && !blocking_author?
end end