commit: 39108c5f128d9d5933f038773dc72d2e25a49564
parent a9aa810d3dadaac5a40d18f56ab41b6276206db1
Author: Mark Felder <feld@feld.me>
Date: Thu, 22 Aug 2024 13:43:01 -0400
Remove unnecessary re-fetch of the actor
Diffstat:
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/pleroma/user/import.ex b/lib/pleroma/user/import.ex
@@ -16,11 +16,7 @@ defmodule Pleroma.User.Import do
def perform(:mute_import, %User{} = user, actor) do
with {:ok, %User{} = muted_user} <- User.get_or_fetch(actor),
{_, false} <- {:existing_mute, User.mutes_user?(user, muted_user)},
- {:ok, _} <- User.mute(user, muted_user),
- # User.mute/2 returns a FollowingRelationship not a %User{} like we get
- # from CommonAPI.block/2 or CommonAPI.follow/2, so we fetch again to
- # return the target actor for consistency
- {:ok, muted_user} <- User.get_or_fetch(actor) do
+ {:ok, _} <- User.mute(user, muted_user) do
{:ok, muted_user}
else
{:existing_mute, true} -> :ok