Commit 303289d7 authored by lain's avatar lain
Browse files

MastodonAPI search: return only create activities.

parent f5943f4a
Pipeline #1103 passed with stage
in 3 minutes and 35 seconds
......@@ -494,6 +494,10 @@ def search(%{assigns: %{user: user}} = conn, %{"q" => query} = params) 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment