projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix atom leak in AdminAPIController
[akkoma]
/
lib
/
pleroma
/
activity
/
queries.ex
diff --git
a/lib/pleroma/activity/queries.ex
b/lib/pleroma/activity/queries.ex
index 633eca0b31095b3a8a03609bc71e3cd8597c32db..c99aae44bb27428eedc2e8bbf84a694b2e55cd10 100644
(file)
--- a/
lib/pleroma/activity/queries.ex
+++ b/
lib/pleroma/activity/queries.ex
@@
-32,6
+32,13
@@
defmodule Pleroma.Activity.Queries do
from(a in query, where: a.actor == ^ap_id)
end
from(a in query, where: a.actor == ^ap_id)
end
+ def find_by_object_ap_id(activities, object_ap_id) do
+ Enum.find(
+ activities,
+ &(object_ap_id in [is_map(&1.data["object"]) && &1.data["object"]["id"], &1.data["object"]])
+ )
+ end
+
@spec by_object_id(query, String.t() | [String.t()]) :: query
def by_object_id(query \\ Activity, object_id)
@spec by_object_id(query, String.t() | [String.t()]) :: query
def by_object_id(query \\ Activity, object_id)