From 13c944a04b217a534cd9ef0d0f9d8dfd65609faf Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Sun, 26 Jul 2026 12:03:24 +0400 Subject: [PATCH] fix(search): index remote attachment descriptions --- lib/pleroma/search.ex | 1 + test/pleroma/search_test.exs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/pleroma/search.ex b/lib/pleroma/search.ex index cd4907026..0d9c7c6e3 100644 --- a/lib/pleroma/search.ex +++ b/lib/pleroma/search.ex @@ -78,6 +78,7 @@ defmodule Pleroma.Search do defp attachment_names(attachments) when is_list(attachments) do Enum.map(attachments, fn + %{"summary" => summary} when is_binary(summary) -> summary %{"name" => name} -> name _ -> nil end) diff --git a/test/pleroma/search_test.exs b/test/pleroma/search_test.exs index 00d8b10ed..91521b1a5 100644 --- a/test/pleroma/search_test.exs +++ b/test/pleroma/search_test.exs @@ -83,6 +83,11 @@ defmodule Pleroma.SearchTest do "summary" => "subject text", "attachment" => [ %{"type" => "Document", "name" => "image description"}, + %{ + "type" => "Document", + "name" => "remote-image.jpg", + "summary" => "remote image description" + }, %{"type" => "Document", "name" => ""} ], "published" => DateTime.utc_now() |> DateTime.to_iso8601() @@ -93,6 +98,8 @@ defmodule Pleroma.SearchTest do assert content =~ "body text" assert content =~ "subject text" assert content =~ "image description" + assert content =~ "remote image description" + refute content =~ "remote-image.jpg" end test "object_to_search_data ignores objects with invalid published dates" do