Alternative implementation of hashtag-filtering queries in ActivityPub. Fixed GROUP BY clause for aggregation on hashtags.

This commit is contained in:
Ivan Tashkinov 2020-12-31 12:45:23 +03:00
commit 303055456f
2 changed files with 100 additions and 22 deletions

View file

@ -113,6 +113,7 @@ defmodule Pleroma.Activity do
from([a] in query,
left_join: b in Bookmark,
on: b.user_id == ^user.id and b.activity_id == a.id,
as: :bookmark,
preload: [bookmark: b]
)
end
@ -123,6 +124,7 @@ defmodule Pleroma.Activity do
from([a] in query,
left_join: r in ReportNote,
on: a.id == r.activity_id,
as: :report_note,
preload: [report_notes: r]
)
end