From 39108c5f128d9d5933f038773dc72d2e25a49564 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 22 Aug 2024 13:43:01 -0400 Subject: [PATCH] Remove unnecessary re-fetch of the actor --- lib/pleroma/user/import.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/pleroma/user/import.ex b/lib/pleroma/user/import.ex index 400e62153..b79fa88eb 100644 --- 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