Change: 時限投稿はフォロワー以外にはActivityを発行しない (#250)
* Change: 時限投稿はフォロワー以外にはActivityを発行しない * Fix: ドメイン単位の認証になるように * Add test and fix * Fix lint * Fix test * Fix test * Revert "Fix test" This reverts commit22f1114b7f
. * Revert "Fix lint" This reverts commita828efa9be
. * Revert "Revert "Fix lint"" This reverts commit6a2d68f28a
. * Revert "Revert "Fix test"" This reverts commita21c0b9d3e
.
This commit is contained in:
parent
faf791c602
commit
789afccf9b
5 changed files with 66 additions and 1 deletions
|
@ -28,6 +28,13 @@ class StatusPolicy < ApplicationPolicy
|
|||
record.limited_visibility? ? owned_conversation? : owned?
|
||||
end
|
||||
|
||||
def show_activity?
|
||||
return false unless show?
|
||||
return true unless record.expires?
|
||||
|
||||
following_author_domain?
|
||||
end
|
||||
|
||||
def reblog?
|
||||
!requires_mention? && (!private? || owned?) && show? && !blocking_author?
|
||||
end
|
||||
|
@ -115,6 +122,12 @@ class StatusPolicy < ApplicationPolicy
|
|||
@preloaded_relations[:following] ? @preloaded_relations[:following][author.id] : current_account.following?(author)
|
||||
end
|
||||
|
||||
def following_author_domain?
|
||||
return false if current_account.nil?
|
||||
|
||||
author.followed_by_domain?(current_account.domain, record.created_at)
|
||||
end
|
||||
|
||||
def author
|
||||
record.account
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue