Merge branch 'kb_development' into kb_migration
This commit is contained in:
commit
9fa468a4bf
30 changed files with 239 additions and 49 deletions
|
@ -53,6 +53,7 @@
|
|||
# group_allow_private_message :boolean
|
||||
# searchability :integer default("private"), not null
|
||||
# dissubscribable :boolean default(FALSE), not null
|
||||
# stop_emoji_reaction_streaming :boolean default(FALSE)
|
||||
#
|
||||
|
||||
class Account < ApplicationRecord
|
||||
|
|
|
@ -27,8 +27,8 @@ class AccountStatusesFilter
|
|||
scope.merge!(hashtag_scope) if tagged?
|
||||
|
||||
scope.merge!(scope.where(searchability: :public)) if domain_block&.reject_send_not_public_searchability
|
||||
scope.merge!(scope.where.not(visibility: :unlisted)) if domain_block&.reject_send_unlisted_dissubscribable && @account.dissubscribable
|
||||
scope.merge!(scope.where.not(visibility: :public_unlisted)) if domain_block&.reject_send_public_unlisted
|
||||
scope.merge!(scope.where.not(visibility: :public_unlisted)) if domain_block&.reject_send_public_unlisted || (domain_block&.detect_invalid_subscription && @account.user&.setting_reject_public_unlisted_subscription)
|
||||
scope.merge!(scope.where.not(visibility: :unlisted)) if domain_block&.detect_invalid_subscription && @account.user&.setting_reject_unlisted_subscription
|
||||
scope.merge!(scope.where(spoiler_text: ['', nil])) if domain_block&.reject_send_sensitive
|
||||
|
||||
scope
|
||||
|
|
|
@ -31,6 +31,18 @@ module HasUserSettings
|
|||
settings['public_post_to_unlisted']
|
||||
end
|
||||
|
||||
def setting_reject_public_unlisted_subscription
|
||||
settings['reject_public_unlisted_subscription']
|
||||
end
|
||||
|
||||
def setting_reject_unlisted_subscription
|
||||
settings['reject_unlisted_subscription']
|
||||
end
|
||||
|
||||
def setting_send_without_domain_blocks
|
||||
settings['send_without_domain_blocks']
|
||||
end
|
||||
|
||||
def setting_unfollow_modal
|
||||
settings['web.unfollow_modal']
|
||||
end
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# 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
|
||||
|
@ -27,6 +26,7 @@
|
|||
# reject_new_follow :boolean default(FALSE), not null
|
||||
# hidden :boolean default(FALSE), not null
|
||||
# hidden_anonymous :boolean default(FALSE), not null
|
||||
# detect_invalid_subscription :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
class DomainBlock < ApplicationRecord
|
||||
|
@ -59,7 +59,6 @@ class DomainBlock < ApplicationRecord
|
|||
reject_favourite? ? :reject_favourite : nil,
|
||||
reject_reply? ? :reject_reply : nil,
|
||||
reject_send_not_public_searchability? ? :reject_send_not_public_searchability : nil,
|
||||
reject_send_unlisted_dissubscribable? ? :reject_send_unlisted_dissubscribable : nil,
|
||||
reject_send_public_unlisted? ? :reject_send_public_unlisted : nil,
|
||||
reject_send_dissubscribable? ? :reject_send_dissubscribable : nil,
|
||||
reject_send_media? ? :reject_send_media : nil,
|
||||
|
@ -67,6 +66,7 @@ class DomainBlock < ApplicationRecord
|
|||
reject_hashtag? ? :reject_hashtag : nil,
|
||||
reject_straight_follow? ? :reject_straight_follow : nil,
|
||||
reject_new_follow? ? :reject_new_follow : nil,
|
||||
detect_invalid_subscription? ? :detect_invalid_subscription : nil,
|
||||
reject_reports? ? :reject_reports : nil
|
||||
].reject { |policy| policy == :noop || policy.nil? }
|
||||
end
|
||||
|
|
|
@ -17,6 +17,9 @@ class UserSettings
|
|||
setting :default_privacy, default: nil
|
||||
setting :default_searchability, default: :private
|
||||
setting :public_post_to_unlisted, default: false
|
||||
setting :reject_public_unlisted_subscription, default: false
|
||||
setting :reject_unlisted_subscription, default: false
|
||||
setting :send_without_domain_blocks, default: false
|
||||
|
||||
namespace :web do
|
||||
setting :crop_images, default: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue