Skip to content
Snippets Groups Projects
Commit b036a19c authored by kaniini's avatar kaniini
Browse files

activity: add normalize() to find a complete activity given either URI or partial structure

parent a2009432
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment