Commit 9bdea19d authored by lain's avatar lain
Browse files

For non-create activities, grab the create activity to fav/rt

parent cd522d21
......@@ -129,7 +129,12 @@ def upload_json(conn, %{"media" => media}) do
end
def get_by_id_or_ap_id(id) do
Repo.get(Activity, id) || Activity.get_create_activity_by_object_ap_id(id)
activity = Repo.get(Activity, id) || Activity.get_create_activity_by_object_ap_id(id)
if activity.data["type"] == "Create" do
activity
else
Activity.get_create_activity_by_object_ap_id(activity.data["object"])
end
end
def favorite(%{assigns: %{user: user}} = conn, %{"id" => id}) do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment