From: William Pitcock Date: Sun, 27 May 2018 13:51:13 +0000 (+0000) Subject: activitypub: when unfollowing, update the follow activity's disposition to 'cancelled... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=76f80ba8c23798d69ecc6b89d6fd42a1d37adeed;p=akkoma activitypub: when unfollowing, update the follow activity's disposition to 'cancelled' so it cannot be reused --- diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 43e96fe37..3c2875548 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -214,6 +214,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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