Restrict `get_existing_votes` to only get Create activities
authorrinpatch <rinpatch@sdf.org>
Tue, 4 Jun 2019 09:42:10 +0000 (12:42 +0300)
committerrinpatch <rinpatch@sdf.org>
Tue, 4 Jun 2019 09:42:10 +0000 (12:42 +0300)
lib/pleroma/web/activity_pub/utils.ex

index b8159e9e5d1cdc2eb57fdf06208db5e2cf6297c1..faae7e747f4a100755c5e6cf78a1b22cae80e236 100644 (file)
@@ -794,6 +794,7 @@ 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(