1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2024-12-27 07:15:13 +01:00

MastodonAPI search: return only create activities.

This commit is contained in:
lain 2018-04-05 13:59:53 +02:00
parent f5943f4a59
commit 303289d7da

View File

@ -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