Restrict `get_existing_votes` to only get Create activities
[akkoma] / lib / pleroma / web / activity_pub / utils.ex
index b292d7d8d57c8de9e2af8c856aab16d34ee0fda1..faae7e747f4a100755c5e6cf78a1b22cae80e236 100644 (file)
@@ -794,10 +794,11 @@ defmodule Pleroma.Web.ActivityPub.Utils do
     query =
       from(
         [activity, object: object] in Activity.with_preloaded_object(Activity),
+        where: fragment("(?)->>'type' = 'Create'", activity.data),
         where: fragment("(?)->>'actor' = ?", activity.data, ^actor),
         where:
           fragment(
-            "(?)->'inReplyTo' = ?",
+            "(?)->>'inReplyTo' = ?",
             object.data,
             ^to_string(id)
           ),