Add fetching of activities in context.

This commit is contained in:
Roger Braun 2017-03-24 00:09:08 +01:00
commit 866a2663d4
2 changed files with 18 additions and 0 deletions

View file

@ -60,4 +60,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
Repo.all(query)
|> Enum.reverse
end
def fetch_activities_for_context(context) do
query = from activity in Activity,
where: fragment("? @> ?", activity.data, ^%{ context: context })
Repo.all(query)
end
end