forked from AkkomaGang/akkoma
Remove unused "muted" parameter, use piping for mute/block fns
This commit is contained in:
parent
092b1b1453
commit
465b547c90
1 changed files with 5 additions and 5 deletions
|
@ -888,13 +888,13 @@ def blocks_import(%User{} = blocker, blocked_identifiers) when is_list(blocked_i
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def mute(muter, %User{ap_id: ap_id} = muted) do
|
def mute(muter, %User{ap_id: ap_id}) do
|
||||||
mutes = muter.info["mutes"] || []
|
mutes = muter.info["mutes"] || []
|
||||||
new_mutes = Enum.uniq([ap_id | mutes])
|
new_mutes = Enum.uniq([ap_id | mutes])
|
||||||
new_info = Map.put(muter.info, "mutes", new_mutes)
|
new_info = Map.put(muter.info, "mutes", new_mutes)
|
||||||
|
|
||||||
cs = User.info_changeset(muter, %{info: new_info})
|
User.info_changeset(muter, %{info: new_info})
|
||||||
update_and_set_cache(cs)
|
|> update_and_set_cache()
|
||||||
end
|
end
|
||||||
|
|
||||||
def unmute(user, %{ap_id: ap_id}) do
|
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_mutes = List.delete(mutes, ap_id)
|
||||||
new_info = Map.put(user.info, "mutes", new_mutes)
|
new_info = Map.put(user.info, "mutes", new_mutes)
|
||||||
|
|
||||||
cs = User.info_changeset(user, %{info: new_info})
|
User.info_changeset(user, %{info: new_info})
|
||||||
update_and_set_cache(cs)
|
|> update_and_set_cache()
|
||||||
end
|
end
|
||||||
|
|
||||||
def block(blocker, %User{ap_id: ap_id} = blocked) do
|
def block(blocker, %User{ap_id: ap_id} = blocked) do
|
||||||
|
|
Loading…
Reference in a new issue