forked from AkkomaGang/akkoma
MastodonAPI search: return only create activities.
This commit is contained in:
parent
f5943f4a59
commit
303289d7da
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue