diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-03-24 00:09:08 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-03-24 00:09:08 +0100 |
commit | 866a2663d4093204317aba7ff87a6d93eaf805fd (patch) | |
tree | 8a03b3eef18d4d79ec2d59ed76a9fe769f29d2bb /lib/pleroma | |
parent | ae50b165cced7fda1e62f677f959c6f202127aa7 (diff) | |
download | pleroma-866a2663d4093204317aba7ff87a6d93eaf805fd.tar.gz |
Add fetching of activities in context.
Diffstat (limited to 'lib/pleroma')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index d14ce3570..043e33042 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -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 |