From 127a5a7d6567124b834a1f5399a0032c1c1f849d Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 21 Jun 2019 22:27:14 +0000 Subject: [PATCH] change the anti-link-spam MRF implementation to use old_user? instead of the previous name --- lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex b/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex index 14e5955ee..2da3eac2f 100644 --- a/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex @@ -8,7 +8,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy do require Logger # has the user successfully posted before? - defp user_has_posted_before?(%User{} = u) do + defp old_user?(%User{} = u) do u.info.note_count > 0 || u.info.follower_count > 0 end @@ -25,13 +25,13 @@ defp contains_links?(_), do: false def filter(%{"type" => "Create", "actor" => actor, "object" => object} = message) do with {:ok, %User{} = u} <- User.get_or_fetch_by_ap_id(actor), {:contains_links, true} <- {:contains_links, contains_links?(object)}, - {:posted_before, true} <- {:posted_before, user_has_posted_before?(u)} do + {:old_user, true} <- {:old_user, old_user?(u)} do {:ok, message} else {:contains_links, false} -> {:ok, message} - {:posted_before, false} -> + {:old_user, false} -> {:reject, nil} {:error, _} ->