mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-17 18:49:15 +00:00
mix format
This commit is contained in:
parent
cba2c5725f
commit
4b765b1886
|
@ -54,11 +54,10 @@ defp filter_allowed_user_by_ap_id(ap_ids, excluded_ap_ids) do
|
||||||
|
|
||||||
defp filter_allowed_users_by_domain(ap_ids, %User{} = for_user) do
|
defp filter_allowed_users_by_domain(ap_ids, %User{} = for_user) do
|
||||||
Enum.reject(ap_ids, fn ap_id ->
|
Enum.reject(ap_ids, fn ap_id ->
|
||||||
User.blocks_domain?(for_user, ap_id)
|
User.blocks_domain?(for_user, ap_id)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
defp filter_allowed_users_by_domain(ap_ids, nil), do: ap_ids
|
defp filter_allowed_users_by_domain(ap_ids, nil), do: ap_ids
|
||||||
|
|
||||||
def filter_allowed_users(reactions, user, with_muted) do
|
def filter_allowed_users(reactions, user, with_muted) do
|
||||||
|
@ -80,7 +79,6 @@ def filter_allowed_users(reactions, user, with_muted) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
reactions
|
reactions
|
||||||
|> Stream.map(fn
|
|> Stream.map(fn
|
||||||
[emoji, users, url] when is_list(users) -> filter_emoji.(emoji, users, url)
|
[emoji, users, url] when is_list(users) -> filter_emoji.(emoji, users, url)
|
||||||
|
|
|
@ -62,7 +62,7 @@ test "has an emoji reaction list" do
|
||||||
account_ids: [other_user.id, user.id]
|
account_ids: [other_user.id, user.id]
|
||||||
},
|
},
|
||||||
%{name: "🍵", count: 1, me: false, url: nil, account_ids: [third_user.id]},
|
%{name: "🍵", count: 1, me: false, url: nil, account_ids: [third_user.id]},
|
||||||
%{name: "😈", count: 1, me: false, url: nil, account_ids: [domain_blocked_user.id]}
|
%{name: "😈", count: 1, me: false, url: nil, account_ids: [domain_blocked_user.id]}
|
||||||
]
|
]
|
||||||
|
|
||||||
status = StatusView.render("show.json", activity: activity, for: user)
|
status = StatusView.render("show.json", activity: activity, for: user)
|
||||||
|
@ -81,7 +81,7 @@ test "has an emoji reaction list" do
|
||||||
%{name: "🍵", count: 1, me: false, url: nil, account_ids: [third_user.id]}
|
%{name: "🍵", count: 1, me: false, url: nil, account_ids: [third_user.id]}
|
||||||
]
|
]
|
||||||
|
|
||||||
refute Enum.any?(status[:pleroma][:emoji_reactions], fn reaction -> reaction[:name] == "😈" end)
|
refute Enum.any?(status[:pleroma][:emoji_reactions], fn reaction -> reaction[:name] == "😈" end)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "works correctly with badly formatted emojis" do
|
test "works correctly with badly formatted emojis" do
|
||||||
|
|
Loading…
Reference in a new issue