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

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

* Fix: ドメイン単位の認証になるように

* Add test and fix

* Fix lint

* Fix test

* Fix test

* Revert "Fix test"

This reverts commit 22f1114b7f.

* Revert "Fix lint"

This reverts commit a828efa9be.

* Revert "Revert "Fix lint""

This reverts commit 6a2d68f28a.

* Revert "Revert "Fix test""

This reverts commit a21c0b9d3e.
This commit is contained in:
KMY(雪あすか) 2023-12-21 11:21:33 +09:00 committed by GitHub
parent faf791c602
commit 789afccf9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 1 deletions

View file

@ -198,6 +198,15 @@ module Account::Interactions
other_account.following?(self)
end
def followed_by_domain?(other_domain, since = nil)
return true if other_domain.blank?
return false unless local?
scope = followers
scope = scope.where('follows.created_at < ?', since) if since.present?
scope.exists?(domain: other_domain)
end
def mutual?(other_account)
following?(other_account) && followed_by?(other_account)
end

View file

@ -253,6 +253,10 @@ class Status < ApplicationRecord
!quote_of_id.nil? && !quote.nil?
end
def expires?
scheduled_expiration_status.present?
end
def within_realtime_window?
created_at >= REAL_TIME_WINDOW.ago
end