Add: ホワイトリスト運用時、承認待ちリモートアカウントの概念ならびに操作画面 (#584)

* Add: ホワイトリスト運用時、承認待ちリモートアカウントの概念ならびに操作画面

* Fix test

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-02-17 21:07:37 +09:00 committed by GitHub
parent 0048a8368e
commit 0f680a21b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 174 additions and 20 deletions

View file

@ -55,6 +55,7 @@
# settings :jsonb
# indexable :boolean default(FALSE), not null
# master_settings :jsonb
# remote_pending :boolean default(FALSE), not null
#
class Account < ApplicationRecord
@ -122,6 +123,7 @@ class Account < ApplicationRecord
scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) }
scope :silenced, -> { where.not(silenced_at: nil) }
scope :suspended, -> { where.not(suspended_at: nil) }
scope :remote_pending, -> { where(remote_pending: true).where.not(suspended_at: nil) }
scope :sensitized, -> { where.not(sensitized_at: nil) }
scope :without_suspended, -> { where(suspended_at: nil) }
scope :without_silenced, -> { where(silenced_at: nil) }
@ -295,6 +297,16 @@ class Account < ApplicationRecord
end
end
def approve_remote!
update!(remote_pending: false)
unsuspend!
end
def reject_remote!
update!(remote_pending: false)
suspend!
end
def sensitized?
sensitized_at.present?
end