mix format

This commit is contained in:
FloatingGhost 2022-06-11 16:14:31 +01:00
parent 32fbd2e4e3
commit 24bf8c3977
6 changed files with 16 additions and 2 deletions

View file

@ -164,5 +164,4 @@ defmodule Pleroma.Emoji do
end end
def maybe_quote(name), do: name def maybe_quote(name), do: name
end end

View file

@ -69,6 +69,7 @@ defmodule Pleroma.HTTP do
adapter = Application.get_env(:tesla, :adapter) adapter = Application.get_env(:tesla, :adapter)
client = Tesla.client(adapter_middlewares(adapter), adapter) client = Tesla.client(adapter_middlewares(adapter), adapter)
maybe_limit( maybe_limit(
fn -> fn ->
request(client, request) request(client, request)

View file

@ -96,9 +96,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactValidator do
else else
tag = get_field(cng, :tag) tag = get_field(cng, :tag)
emoji_name = Emoji.stripped_name(content) emoji_name = Emoji.stripped_name(content)
case tag do case tag do
[%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] -> [%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] ->
cng cng
_ -> _ ->
cng cng
|> add_error(:tag, "does not contain an Emoji tag") |> add_error(:tag, "does not contain an Emoji tag")

View file

@ -10,6 +10,7 @@ defmodule Pleroma.HTTPTest do
setup do setup do
clear_config([:http, :send_user_agent], false) clear_config([:http, :send_user_agent], false)
mock(fn mock(fn
%{ %{
method: :get, method: :get,

View file

@ -73,7 +73,17 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do
object = Object.get_by_ap_id(data["object"]) object = Object.get_by_ap_id(data["object"])
assert object.data["reaction_count"] == 1 assert object.data["reaction_count"] == 1
assert match?([["hanapog", _, "https://misskey.local.live/files/webpublic-8f8a9768-7264-4171-88d6-2356aabeadcd"]], object.data["reactions"])
assert match?(
[
[
"hanapog",
_,
"https://misskey.local.live/files/webpublic-8f8a9768-7264-4171-88d6-2356aabeadcd"
]
],
object.data["reactions"]
)
end end
test "it reject invalid emoji reactions" do test "it reject invalid emoji reactions" do

View file

@ -323,6 +323,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"])) |> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
|> get("/api/v1/search?#{query}") |> get("/api/v1/search?#{query}")
|> json_response_and_validate_schema(200) |> json_response_and_validate_schema(200)
[account] = results["accounts"] [account] = results["accounts"]
assert account["acct"] == "mike@osada.macgirvin.com" assert account["acct"] == "mike@osada.macgirvin.com"
end end