From 210b23cfc7893e0fa979cc7828958298e87d1f2b Mon Sep 17 00:00:00 2001 From: KMY Date: Wed, 6 Dec 2023 13:11:38 +0900 Subject: [PATCH] Fix lint --- app/lib/activitypub/parser/custom_emoji_parser.rb | 2 +- app/models/admin/sensitive_word.rb | 2 +- app/services/activitypub/process_account_service.rb | 4 ++-- app/views/filters/_filter_fields.html.haml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/lib/activitypub/parser/custom_emoji_parser.rb b/app/lib/activitypub/parser/custom_emoji_parser.rb index e2c48b0a907f73..68a01c64368b52 100644 --- a/app/lib/activitypub/parser/custom_emoji_parser.rb +++ b/app/lib/activitypub/parser/custom_emoji_parser.rb @@ -30,7 +30,7 @@ def updated_at 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 ab457382b9ef64..ec905fe0759022 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 5c965fdb44ffac..895574d5a2aed7 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -82,7 +82,7 @@ def create_account @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 @@ def process_emoji(tag) 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 dfd104330eb655..f334e0a373b480 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')