From 465b547c905b4faa26ec1cf5f0175c55430e8041 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Tue, 4 Sep 2018 00:20:22 +0300 Subject: [PATCH] Remove unused "muted" parameter, use piping for mute/block fns --- lib/pleroma/user.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index da25a91c8..cfb44ebaa 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -888,13 +888,13 @@ def blocks_import(%User{} = blocker, blocked_identifiers) when is_list(blocked_i ) end - def mute(muter, %User{ap_id: ap_id} = muted) do + def mute(muter, %User{ap_id: ap_id}) do mutes = muter.info["mutes"] || [] new_mutes = Enum.uniq([ap_id | mutes]) new_info = Map.put(muter.info, "mutes", new_mutes) - cs = User.info_changeset(muter, %{info: new_info}) - update_and_set_cache(cs) + User.info_changeset(muter, %{info: new_info}) + |> update_and_set_cache() end def unmute(user, %{ap_id: ap_id}) do @@ -902,8 +902,8 @@ def unmute(user, %{ap_id: ap_id}) do new_mutes = List.delete(mutes, ap_id) new_info = Map.put(user.info, "mutes", new_mutes) - cs = User.info_changeset(user, %{info: new_info}) - update_and_set_cache(cs) + User.info_changeset(user, %{info: new_info}) + |> update_and_set_cache() end def block(blocker, %User{ap_id: ap_id} = blocked) do