mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 16:40:29 +00:00
activity: add normalize() to find a complete activity given either URI or partial structure
This commit is contained in:
parent
a200943240
commit
b036a19c21
1 changed files with 4 additions and 0 deletions
|
@ -78,4 +78,8 @@ defmodule Pleroma.Activity do
|
|||
end
|
||||
|
||||
def get_create_activity_by_object_ap_id(_), do: nil
|
||||
|
||||
def normalize(obj) when is_map(obj), do: Activity.get_by_ap_id(obj["id"])
|
||||
def normalize(ap_id) when is_binary(ap_id), do: Activity.get_by_ap_id(ap_id)
|
||||
def normalize(_), do: nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue