[#468] Refactored OAuth scopes' defaults & missing selection handling.
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 4635e7fcd674a438a632d7b9dc1ab4c0bc51c196..b33912721782fb05cfbf3f32ee0fed3b7f2412b8 100644 (file)
@@ -521,7 +521,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
   defp restrict_actor(query, _), do: query
 
   defp restrict_type(query, %{"type" => type}) when is_binary(type) do
-    restrict_type(query, %{"type" => [type]})
+    from(activity in query, where: fragment("?->>'type' = ?", activity.data, ^type))
   end
 
   defp restrict_type(query, %{"type" => type}) do