Activity.Queries: Use correct actor restriction.
authorlain <lain@soykaf.club>
Tue, 26 May 2020 15:46:16 +0000 (17:46 +0200)
committerlain <lain@soykaf.club>
Tue, 26 May 2020 15:46:16 +0000 (17:46 +0200)
lib/pleroma/activity/queries.ex

index a34c20343471582e7c0dbb8e0bebd647d5cd83e0..c99aae44bb27428eedc2e8bbf84a694b2e55cd10 100644 (file)
@@ -24,10 +24,7 @@ defmodule Pleroma.Activity.Queries do
 
   @spec by_actor(query, String.t()) :: query
   def by_actor(query \\ Activity, actor) do
-    from(
-      activity in query,
-      where: fragment("(?)->>'actor' = ?", activity.data, ^actor)
-    )
+    from(a in query, where: a.actor == ^actor)
   end
 
   @spec by_author(query, User.t()) :: query