From 37779910df5a5f7036f8dc4bb71834cb98d2b30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Thu, 2 Nov 2023 13:56:26 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC=E3=81=AE=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E3=83=97=E5=88=A9=E7=94=A8=E5=8F=AF=E5=90=A6=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=8F=E5=8F=8D=E6=98=A0=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=20(#219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: ローカルサーバーのスタンプ利用可否が正しく反映できない問題 * 不要な分岐を削除 * Fix: Presenterの使用を中止(どうせキャッシュしてるので) --- app/models/instance_info.rb | 2 -- app/presenters/status_relationships_presenter.rb | 2 -- app/serializers/rest/status_serializer.rb | 8 +++----- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/models/instance_info.rb b/app/models/instance_info.rb index 0641471ac2549e..4afe4f98c62222 100644 --- a/app/models/instance_info.rb +++ b/app/models/instance_info.rb @@ -33,8 +33,6 @@ def self.emoji_reaction_available?(domain) end def self.fetch_emoji_reaction_available(domain) - return Setting.enable_emoji_reaction if domain.nil? - info = InstanceInfo.find_by(domain: domain) return false if info.nil? diff --git a/app/presenters/status_relationships_presenter.rb b/app/presenters/status_relationships_presenter.rb index d9453903ebfce8..fad18a1ab32f91 100644 --- a/app/presenters/status_relationships_presenter.rb +++ b/app/presenters/status_relationships_presenter.rb @@ -19,7 +19,6 @@ def initialize(statuses, current_account_id = nil, **options) @pins_map = {} @filters_map = {} @emoji_reaction_allows_map = nil - @emoji_reaction_availables_map = {} else statuses = statuses.compact statuses += statuses.filter_map(&:quote) @@ -36,7 +35,6 @@ def initialize(statuses, current_account_id = nil, **options) @domain_blocks_map = Status.domain_blocks_map(statuses.filter_map { |status| status.account.domain }.uniq, current_account_id).merge(options[:domain_blocks_map] || {}) @pins_map = Status.pins_map(pinnable_status_ids, current_account_id).merge(options[:pins_map] || {}) @emoji_reaction_allows_map = Status.emoji_reaction_allows_map(status_ids, current_account_id).merge(options[:emoji_reaction_allows_map] || {}) - @emoji_reaction_availables_map = Status.emoji_reaction_availables_map(statuses.filter_map { |status| status.account.domain }.uniq).merge(options[:emoji_reaction_availables_map] || {}) @attributes_map = options[:attributes_map] || {} end end diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index d6c4b5422830e1..44ceae59f023c4 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -167,11 +167,9 @@ def show_emoji_reaction? end def emoji_reaction_available_server - if relationships - relationships.emoji_reaction_availables_map[object.account.domain] || false - else - InstanceInfo.emoji_reaction_available?(object.account.domain) - end + return Setting.enable_emoji_reaction if object.local? + + InstanceInfo.emoji_reaction_available?(object.account.domain) end def reactions