activitypub: when unfollowing, update the follow activity's disposition to 'cancelled' so it cannot be reused
This commit is contained in:
parent
a2c4a5a75b
commit
76f80ba8c2
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue