mix format
This commit is contained in:
parent
32fbd2e4e3
commit
24bf8c3977
6 changed files with 16 additions and 2 deletions
|
@ -164,5 +164,4 @@ defmodule Pleroma.Emoji do
|
|||
end
|
||||
|
||||
def maybe_quote(name), do: name
|
||||
|
||||
end
|
||||
|
|
|
@ -69,6 +69,7 @@ defmodule Pleroma.HTTP do
|
|||
adapter = Application.get_env(:tesla, :adapter)
|
||||
|
||||
client = Tesla.client(adapter_middlewares(adapter), adapter)
|
||||
|
||||
maybe_limit(
|
||||
fn ->
|
||||
request(client, request)
|
||||
|
|
|
@ -96,9 +96,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactValidator do
|
|||
else
|
||||
tag = get_field(cng, :tag)
|
||||
emoji_name = Emoji.stripped_name(content)
|
||||
|
||||
case tag do
|
||||
[%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] ->
|
||||
cng
|
||||
|
||||
_ ->
|
||||
cng
|
||||
|> add_error(:tag, "does not contain an Emoji tag")
|
||||
|
|
|
@ -10,6 +10,7 @@ defmodule Pleroma.HTTPTest do
|
|||
|
||||
setup do
|
||||
clear_config([:http, :send_user_agent], false)
|
||||
|
||||
mock(fn
|
||||
%{
|
||||
method: :get,
|
||||
|
|
|
@ -73,7 +73,17 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do
|
|||
object = Object.get_by_ap_id(data["object"])
|
||||
|
||||
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
|
||||
|
||||
test "it reject invalid emoji reactions" do
|
||||
|
|
|
@ -323,6 +323,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
|
|||
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
|
||||
|> get("/api/v1/search?#{query}")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
[account] = results["accounts"]
|
||||
assert account["acct"] == "mike@osada.macgirvin.com"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue