Skip to content
Snippets Groups Projects
Commit a2ca3b86 authored by lain's avatar lain
Browse files

Add option to keep id for follows.

parent 36448d64
No related branches found
No related tags found
No related merge requests found
......@@ -218,7 +218,7 @@ def announce(%User{ap_id: ap_id} = user, %Object{data: %{"id" => id}} = object,
{:ok, activity, object}
end
def follow(%User{ap_id: follower_id, local: actor_local}, %User{ap_id: followed_id}, local \\ true) do
def follow(%User{ap_id: follower_id, local: actor_local}, %User{ap_id: followed_id}, activity_id \\ nil, local \\ true) do
data = %{
"type" => "Follow",
"actor" => follower_id,
......@@ -227,6 +227,8 @@ def follow(%User{ap_id: follower_id, local: actor_local}, %User{ap_id: followed_
"published" => make_date()
}
data = if activity_id, do: Map.put(data, "id", activity_id), else: data
with {:ok, activity} <- insert(data, local) do
if actor_local do
Pleroma.Web.Federator.enqueue(:publish, activity)
......
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