From: lain Date: Thu, 5 Apr 2018 11:59:53 +0000 (+0200) Subject: MastodonAPI search: return only create activities. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=303289d7daac3a51f991bb8603f36628a5d944c1;p=akkoma MastodonAPI search: return only create activities. --- 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