mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 19:54:40 +00:00
Add option to keep id for follows.
This commit is contained in:
parent
36448d6483
commit
a2ca3b8605
1 changed files with 3 additions and 1 deletions
|
@ -218,7 +218,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
{: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 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
"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)
|
||||
|
|
Loading…
Reference in a new issue