diff --git a/app/lib/activitypub/parser/custom_emoji_parser.rb b/app/lib/activitypub/parser/custom_emoji_parser.rb index e2c48b0a90..68a01c6436 100644 --- a/app/lib/activitypub/parser/custom_emoji_parser.rb +++ b/app/lib/activitypub/parser/custom_emoji_parser.rb @@ -30,7 +30,7 @@ class ActivityPub::Parser::CustomEmojiParser end def is_sensitive # rubocop:disable Naming/PredicateName - (@json['isSensitive'].presence || false) + @json['isSensitive'].presence || false end def license diff --git a/app/models/admin/sensitive_word.rb b/app/models/admin/sensitive_word.rb index ab457382b9..ec905fe075 100644 --- a/app/models/admin/sensitive_word.rb +++ b/app/models/admin/sensitive_word.rb @@ -3,7 +3,7 @@ class Admin::SensitiveWord class << self def sensitive?(text, spoiler_text) - exposure_text = (spoiler_text.presence || text) + exposure_text = spoiler_text.presence || text (spoiler_text.blank? && sensitive_words.any? { |word| include?(text, word) }) || sensitive_words_for_full.any? { |word| include?(exposure_text, word) } end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 5c965fdb44..895574d5a2 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -82,7 +82,7 @@ class ActivityPub::ProcessAccountService < BaseService @account.suspended_at = domain_block.created_at if auto_suspend? @account.suspension_origin = :local if auto_suspend? @account.silenced_at = domain_block.created_at if auto_silence? - @account.searchability = :direct # not null + @account.searchability = :direct # not null set_immediate_protocol_attributes! @@ -448,7 +448,7 @@ class ActivityPub::ProcessAccountService < BaseService shortcode = tag['name'].delete(':') image_url = tag['icon']['url'] uri = tag['id'] - sensitive = (tag['isSensitive'].presence || false) + sensitive = tag['isSensitive'].presence || false license = tag['license'] updated = tag['updated'] emoji = CustomEmoji.find_by(shortcode: shortcode, domain: @account.domain) diff --git a/app/views/filters/_filter_fields.html.haml b/app/views/filters/_filter_fields.html.haml index dfd104330e..f334e0a373 100644 --- a/app/views/filters/_filter_fields.html.haml +++ b/app/views/filters/_filter_fields.html.haml @@ -10,7 +10,7 @@ %hr.spacer/ .fields-group - = f.input :filter_action, as: :radio_buttons, collection: %i(warn hide), include_blank: false, wrapper: :with_block_label, label_method: ->(action) { filter_action_label(action) }, hint: t('simple_form.hints.filters.action'), required: true + = f.input :filter_action, as: :radio_buttons, collection: %i(half_warn warn hide), include_blank: false, wrapper: :with_block_label, label_method: ->(action) { filter_action_label(action) }, hint: t('simple_form.hints.filters.action'), required: true .fields-group = f.input :exclude_follows, wrapper: :with_label, kmyblue: true, label: t('simple_form.labels.filters.options.exclude_follows')