activitypub: help ecto build a better query for thread mute filtering
authorAriadne Conill <ariadne@dereferenced.org>
Fri, 6 Sep 2019 23:11:26 +0000 (23:11 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Fri, 6 Sep 2019 23:11:26 +0000 (23:11 +0000)
using an indexed value in thread_mute table helps ecto build a better query.

lib/pleroma/web/activity_pub/activity_pub.ex

index eeb826814423c620a3dc0e341093d00bccc7ab8e..d23ec66ac4c6afd403099286a48409ac9c125fca 100644 (file)
@@ -796,7 +796,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       )
 
     unless opts["skip_preload"] do
-      from([thread_mute: tm] in query, where: is_nil(tm))
+      from([thread_mute: tm] in query, where: is_nil(tm.user_id))
     else
       query
     end