Commit 5dc68d30 authored by lain's avatar lain

Get objects that people you know favorite.

parent c443aec8
Pipeline #797 failed with stage
in 2 minutes and 21 seconds
...@@ -81,7 +81,7 @@ def handle_incoming(%{"type" => "Follow", "object" => followed, "actor" => follo ...@@ -81,7 +81,7 @@ def handle_incoming(%{"type" => "Follow", "object" => followed, "actor" => follo
def handle_incoming(%{"type" => "Like", "object" => object_id, "actor" => actor, "id" => id} = data) do def handle_incoming(%{"type" => "Like", "object" => object_id, "actor" => actor, "id" => id} = data) do
with %User{} = actor <- User.get_or_fetch_by_ap_id(actor), with %User{} = actor <- User.get_or_fetch_by_ap_id(actor),
%Object{} = object <- Object.get_by_ap_id(object_id), {:ok, object} <- get_obj_helper(object_id) || ActivityPub.fetch_object_from_id(object_id),
{:ok, activity, object} <- ActivityPub.like(actor, object, id, false) do {:ok, activity, object} <- ActivityPub.like(actor, object, id, false) do
{:ok, activity} {:ok, activity}
else else
......
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