activitypub: when unfollowing, update the follow activity's disposition to 'cancelled...
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 27 May 2018 13:51:13 +0000 (13:51 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 11 Jun 2018 22:15:53 +0000 (22:15 +0000)
lib/pleroma/web/activity_pub/activity_pub.ex

index 43e96fe3779f3d1f08bb3339625269fb6d4f9f76..3c2875548e86bc3d1950c7a54575fe1598349371 100644 (file)
@@ -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