diff options
Diffstat (limited to 'lib/pleroma/activity.ex')
-rw-r--r-- | lib/pleroma/activity.ex | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index cdfe7ea9e..66854dc2d 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -113,4 +113,14 @@ defmodule Pleroma.Activity do end def mastodon_notification_type(%Activity{}), do: nil + + def all_by_actor_and_id(actor, status_ids \\ []) + def all_by_actor_and_id(_actor, []), do: [] + + def all_by_actor_and_id(actor, status_ids) do + Activity + |> where([s], s.id in ^status_ids) + |> where([s], s.actor == ^actor) + |> Repo.all() + end end |