commit: 303289d7daac3a51f991bb8603f36628a5d944c1
parent: f5943f4a599d2eacc0b8786039476445a406e330
Author: lain <lain@soykaf.club>
Date: Thu, 5 Apr 2018 13:59:53 +0200
MastodonAPI search: return only create activities.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git 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