Get create activity from created object id.
This is useful for Ostatus federation because ostatus doesn't have different ids for objects and activities...
This commit is contained in:
parent
11ea08649d
commit
9d7c3190cc
3 changed files with 13 additions and 1 deletions
|
|
@ -18,4 +18,9 @@ defmodule Pleroma.Activity do
|
|||
Repo.all(from activity in Activity,
|
||||
where: fragment("? @> ?", activity.data, ^%{object: %{id: ap_id}}))
|
||||
end
|
||||
|
||||
def get_create_activity_by_object_ap_id(ap_id) do
|
||||
Repo.one(from activity in Activity,
|
||||
where: fragment("? @> ?", activity.data, ^%{type: "Create", object: %{id: ap_id}}))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue