From 303289d7daac3a51f991bb8603f36628a5d944c1 Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 5 Apr 2018 13:59:53 +0200 Subject: [PATCH] MastodonAPI search: return only create activities. --- lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 64928fda5..ccba4710a 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -494,6 +494,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do if Regex.match?(~r/https?:/, query) do with {:ok, activities} <- OStatus.fetch_activity_from_url(query) do activities + |> Enum.filter(fn + %{data: %{"type" => "Create"}} -> true + _ -> false + end) else _e -> [] end -- 2.45.2