MastodonAPI search: return only create activities.
authorlain <lain@soykaf.club>
Thu, 5 Apr 2018 11:59:53 +0000 (13:59 +0200)
committerlain <lain@soykaf.club>
Thu, 5 Apr 2018 11:59:53 +0000 (13:59 +0200)
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index 64928fda5bed5aa1a3306caa45c48af67d23930a..ccba4710a7fe99579af3482ccbdd354ec03d5062 100644 (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