aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/activity.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/activity.ex')
-rw-r--r--lib/pleroma/activity.ex8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex
index 40e14005b..0b7188aba 100644
--- a/lib/pleroma/activity.ex
+++ b/lib/pleroma/activity.ex
@@ -15,9 +15,13 @@ defmodule Pleroma.Activity do
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)))
end
+ def all_by_object_ap_id_q(ap_id) do
+ from activity in Activity,
+ where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id))
+ end
+
def all_by_object_ap_id(ap_id) do
- Repo.all(from activity in Activity,
- where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id)))
+ Repo.all(all_by_object_ap_id_q(ap_id))
end
def get_create_activity_by_object_ap_id(ap_id) do