projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4f055b
)
Simplify query.
author
Roger Braun
<rbraun@Bobble.local>
Wed, 18 Oct 2017 09:56:47 +0000
(11:56 +0200)
committer
Roger Braun
<rbraun@Bobble.local>
Wed, 18 Oct 2017 09:56:47 +0000
(11:56 +0200)
lib/pleroma/web/activity_pub/activity_pub.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index 31aa2c4f127798be671ffc9c4ba4ce204c2afdcb..7a15661563368482806da836f73e8f14c2500c73 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub.ex
@@
-118,11
+118,8
@@
defmodule Pleroma.Web.ActivityPub.ActivityPub do
defp restrict_tag(query, _), do: query
defp restrict_recipients(query, recipients) do
- Enum.reduce(recipients, query, fn (recipient, q) ->
- map = %{ to: [recipient] }
- from activity in q,
- or_where: fragment(~s(? @> ?), activity.data, ^map)
- end)
+ from activity in query,
+ where: fragment("?->'to' \\\?| ? ", activity.data, ^recipients)
end
defp restrict_local(query, %{"local_only" => true}) do