summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-08-11 15:41:19 +0200
committerlain <lain@soykaf.club>2020-08-11 15:41:19 +0200
commitda3f9b9988d2cee4baa6018e6450b2d6027e1ce3 (patch)
treeb9988a27f70a88bd0f60caed9bc67bdab7c3c93a /lib
parent8b1e8bec2ffcb3a73eea93015d73b44c4996baff (diff)
downloadpleroma-da3f9b9988d2cee4baa6018e6450b2d6027e1ce3.tar.gz
pleroma-da3f9b9988d2cee4baa6018e6450b2d6027e1ce3.zip
Transmogrifier: Remove handling of orphaned accepts
This was a Mastodon 2.3 issue and has been fixed for a long time. According to fediverse.networks, less than one percent of servers still run a version this old or older.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index fe016e720..5ea97e9b7 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -391,27 +391,11 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
defp fix_content(object), do: object
- defp mastodon_follow_hack(%{"id" => id, "actor" => follower_id}, followed) do
- with true <- id =~ "follows",
- %User{local: true} = follower <- User.get_cached_by_ap_id(follower_id),
- %Activity{} = activity <- Utils.fetch_latest_follow(follower, followed) do
- {:ok, activity}
- else
- _ -> {:error, nil}
- end
- end
-
- defp mastodon_follow_hack(_, _), do: {:error, nil}
-
- defp get_follow_activity(follow_object, followed) do
+ defp get_follow_activity(follow_object, _followed) do
with object_id when not is_nil(object_id) <- Utils.get_ap_id(follow_object),
{_, %Activity{} = activity} <- {:activity, Activity.get_by_ap_id(object_id)} do
{:ok, activity}
else
- # Can't find the activity. This might a Mastodon 2.3 "Accept"
- {:activity, nil} ->
- mastodon_follow_hack(follow_object, followed)
-
_ ->
{:error, nil}
end