Commit 76f80ba8 authored by kaniini's avatar kaniini
Browse files

activitypub: when unfollowing, update the follow activity's disposition to...

activitypub: when unfollowing, update the follow activity's disposition to 'cancelled' so it cannot be reused
parent a2c4a5a7
......@@ -214,6 +214,7 @@ def follow(follower, followed, activity_id \\ nil, local \\ true) do
def unfollow(follower, followed, activity_id \\ nil, local \\ true) do
with %Activity{} = follow_activity <- fetch_latest_follow(follower, followed),
{:ok, follow_activity} <- update_follow_state(follow_activity, "cancelled"),
unfollow_data <- make_unfollow_data(follower, followed, follow_activity, activity_id),
{:ok, activity} <- insert(unfollow_data, local),
:ok <- maybe_federate(activity) 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