mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 16:16:34 +00:00
Remove unnecessary re-fetch of the actor
This commit is contained in:
parent
a9aa810d3d
commit
39108c5f12
1 changed files with 1 additions and 5 deletions
|
@ -16,11 +16,7 @@ defmodule Pleroma.User.Import do
|
||||||
def perform(:mute_import, %User{} = user, actor) do
|
def perform(:mute_import, %User{} = user, actor) do
|
||||||
with {:ok, %User{} = muted_user} <- User.get_or_fetch(actor),
|
with {:ok, %User{} = muted_user} <- User.get_or_fetch(actor),
|
||||||
{_, false} <- {:existing_mute, User.mutes_user?(user, muted_user)},
|
{_, false} <- {:existing_mute, User.mutes_user?(user, muted_user)},
|
||||||
{:ok, _} <- User.mute(user, muted_user),
|
{:ok, _} <- User.mute(user, muted_user) do
|
||||||
# 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, muted_user}
|
{:ok, muted_user}
|
||||||
else
|
else
|
||||||
{:existing_mute, true} -> :ok
|
{:existing_mute, true} -> :ok
|
||||||
|
|
Loading…
Reference in a new issue