mix format
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:31 +0000 (16:14 +0100)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:31 +0000 (16:14 +0100)
lib/pleroma/emoji.ex
lib/pleroma/http.ex
lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
test/pleroma/http_test.exs
test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs

index a3e7e5353276d0a36d2aa75d7eb5f81cbf95db2c..d421f2ccb42d74cec2748b905941769de4004418 100644 (file)
@@ -164,5 +164,4 @@ defmodule Pleroma.Emoji do
   end
 
   def maybe_quote(name), do: name
-    
 end
index 87bdb663e327facdf0ff510523dcfdc118153057..07b3ab0aefcba4a90f49548a258b7a1460bae3b9 100644 (file)
@@ -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)
index b133cbb741ec53e71c8fc013d3e966c45b893319..995395826ed0683b6c1974feea7b7b427e0dac73 100644 (file)
@@ -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")
index cd537729ab2cce1cb994092e24779197cce010fc..e8a2538d30da79e5d9c7ad77447671001625eeef 100644 (file)
@@ -10,6 +10,7 @@ defmodule Pleroma.HTTPTest do
 
   setup do
     clear_config([:http, :send_user_agent], false)
+
     mock(fn
       %{
         method: :get,
index c262ebbc2d3869053faa22939b84b0efff5cbea4..4ab1d29e3f5bad4306af9f140b742338e15f9ac0 100644 (file)
@@ -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
index d0387412c94201fecd6eff828102ff09f4ca7830..e31cd0291fd0e264a8338ded17f77fc0b8dc60bd 100644 (file)
@@ -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