Add domain block sending params
This commit is contained in:
parent
98ced6d69e
commit
401847d8cc
13 changed files with 128 additions and 19 deletions
|
@ -34,6 +34,10 @@ class AccountStatusesFilter
|
|||
def initial_scope
|
||||
if suspended?
|
||||
Status.none
|
||||
elsif domain_block != nil && (domain_block&.reject_send_not_public_searchability || domain_block&.reject_send_unlisted_dissubscribable ||
|
||||
domain_block&.reject_send_public_unlisted || domain_block&.reject_send_media || domain_block&.reject_send_sensitive ||
|
||||
domain_block&.reject_send_sensitive)
|
||||
Status.none
|
||||
elsif anonymous?
|
||||
account.statuses.where(visibility: %i(public unlisted public_unlisted))
|
||||
elsif author?
|
||||
|
@ -131,4 +135,8 @@ class AccountStatusesFilter
|
|||
def truthy_param?(key)
|
||||
ActiveModel::Type::Boolean.new.cast(params[key])
|
||||
end
|
||||
|
||||
def domain_block
|
||||
@domain_block = DomainBlock.find_by(domain: @account&.domain)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,18 +4,24 @@
|
|||
#
|
||||
# Table name: domain_blocks
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# domain :string default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# severity :integer default("silence")
|
||||
# reject_media :boolean default(FALSE), not null
|
||||
# reject_reports :boolean default(FALSE), not null
|
||||
# private_comment :text
|
||||
# public_comment :text
|
||||
# obfuscate :boolean default(FALSE), not null
|
||||
# reject_favourite :boolean default(FALSE), not null
|
||||
# reject_reply :boolean default(FALSE), not null
|
||||
# id :bigint(8) not null, primary key
|
||||
# domain :string default(""), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# severity :integer default("silence")
|
||||
# reject_media :boolean default(FALSE), not null
|
||||
# reject_reports :boolean default(FALSE), not null
|
||||
# private_comment :text
|
||||
# public_comment :text
|
||||
# obfuscate :boolean default(FALSE), not null
|
||||
# reject_favourite :boolean default(FALSE), not null
|
||||
# reject_reply :boolean default(FALSE), not null
|
||||
# reject_send_not_public_searchability :boolean default(FALSE), not null
|
||||
# reject_send_unlisted_dissubscribable :boolean default(FALSE), not null
|
||||
# reject_send_public_unlisted :boolean default(FALSE), not null
|
||||
# reject_send_dissubscribable :boolean default(FALSE), not null
|
||||
# reject_send_media :boolean default(FALSE), not null
|
||||
# reject_send_sensitive :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
class DomainBlock < ApplicationRecord
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue