From f347df4e4c805342e97998862cebf3d26d5eb703 Mon Sep 17 00:00:00 2001 From: KMY Date: Sun, 8 Oct 2023 18:39:20 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=E5=8F=82=E7=85=A7=E3=81=A7=E9=9D=9E?= =?UTF-8?q?=E5=85=AC=E9=96=8B=E6=8A=95=E7=A8=BF=E3=81=8C=E8=A6=8B=E3=81=88?= =?UTF-8?q?=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/statuses_controller.rb | 2 +- app/models/concerns/status_threading_concern.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 1df399405afbbf..065ec07613c9d3 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -44,7 +44,7 @@ def context ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(ancestors_limit, current_account) descendants_results = @status.descendants(descendants_limit, current_account, descendants_depth_limit) - references_results = @status.references + references_results = @status.readable_references(current_account) loaded_ancestors = cache_collection(ancestors_results, Status) loaded_descendants = cache_collection(descendants_results, Status) loaded_references = cache_collection(references_results, Status) diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb index 38d0f393b79587..52b397b47d5ec3 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status_threading_concern.rb @@ -11,6 +11,15 @@ def descendants(limit, account = nil, depth = nil) find_statuses_from_tree_path(descendant_ids(limit, depth), account, promote: true) end + def readable_references(account = nil) + statuses = references.to_a + account_ids = statuses.map(&:account_id).uniq + domains = statuses.filter_map(&:account_domain).uniq + relations = account&.relations_map(account_ids, domains) || {} + statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? } + statuses + end + def self_replies(limit) account.statuses.where(in_reply_to_id: id, visibility: [:public, :unlisted, :public_unlisted, :login]).reorder(id: :asc).limit(limit) end From b8d2a306463cfe8b312aa1f8173917fe1ef78b65 Mon Sep 17 00:00:00 2001 From: KMY Date: Sun, 8 Oct 2023 18:44:35 +0900 Subject: [PATCH 2/2] Bump version to 5.3 LTS --- lib/mastodon/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 611f439135e17a..c5cc6d8ce70226 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -9,7 +9,7 @@ def kmyblue_major end def kmyblue_minor - 2 + 3 end def kmyblue_flag