projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
32fbd2e
)
mix format
author
FloatingGhost
<hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:31 +0000
(16:14 +0100)
committer
FloatingGhost
<hannah@coffee-and-dreams.uk>
Sat, 11 Jun 2022 15:14:31 +0000
(16:14 +0100)
lib/pleroma/emoji.ex
patch
|
blob
|
history
lib/pleroma/http.ex
patch
|
blob
|
history
lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
patch
|
blob
|
history
test/pleroma/http_test.exs
patch
|
blob
|
history
test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
patch
|
blob
|
history
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
patch
|
blob
|
history
diff --git
a/lib/pleroma/emoji.ex
b/lib/pleroma/emoji.ex
index a3e7e5353276d0a36d2aa75d7eb5f81cbf95db2c..d421f2ccb42d74cec2748b905941769de4004418 100644
(file)
--- a/
lib/pleroma/emoji.ex
+++ b/
lib/pleroma/emoji.ex
@@
-164,5
+164,4
@@
defmodule Pleroma.Emoji do
end
def maybe_quote(name), do: name
end
def maybe_quote(name), do: name
-
end
end
diff --git
a/lib/pleroma/http.ex
b/lib/pleroma/http.ex
index 87bdb663e327facdf0ff510523dcfdc118153057..07b3ab0aefcba4a90f49548a258b7a1460bae3b9 100644
(file)
--- a/
lib/pleroma/http.ex
+++ b/
lib/pleroma/http.ex
@@
-69,6
+69,7
@@
defmodule Pleroma.HTTP do
adapter = Application.get_env(:tesla, :adapter)
client = Tesla.client(adapter_middlewares(adapter), adapter)
adapter = Application.get_env(:tesla, :adapter)
client = Tesla.client(adapter_middlewares(adapter), adapter)
+
maybe_limit(
fn ->
request(client, request)
maybe_limit(
fn ->
request(client, request)
diff --git
a/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
b/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
index b133cbb741ec53e71c8fc013d3e966c45b893319..995395826ed0683b6c1974feea7b7b427e0dac73 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex
@@
-96,9
+96,11
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactValidator do
else
tag = get_field(cng, :tag)
emoji_name = Emoji.stripped_name(content)
else
tag = get_field(cng, :tag)
emoji_name = Emoji.stripped_name(content)
+
case tag do
[%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] ->
cng
case tag do
[%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] ->
cng
+
_ ->
cng
|> add_error(:tag, "does not contain an Emoji tag")
_ ->
cng
|> add_error(:tag, "does not contain an Emoji tag")
diff --git
a/test/pleroma/http_test.exs
b/test/pleroma/http_test.exs
index cd537729ab2cce1cb994092e24779197cce010fc..e8a2538d30da79e5d9c7ad77447671001625eeef 100644
(file)
--- a/
test/pleroma/http_test.exs
+++ b/
test/pleroma/http_test.exs
@@
-10,6
+10,7
@@
defmodule Pleroma.HTTPTest do
setup do
clear_config([:http, :send_user_agent], false)
setup do
clear_config([:http, :send_user_agent], false)
+
mock(fn
%{
method: :get,
mock(fn
%{
method: :get,
diff --git
a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
index c262ebbc2d3869053faa22939b84b0efff5cbea4..4ab1d29e3f5bad4306af9f140b742338e15f9ac0 100644
(file)
--- a/
test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
+++ b/
test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs
@@
-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
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
end
test "it reject invalid emoji reactions" do
diff --git
a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
index d0387412c94201fecd6eff828102ff09f4ca7830..e31cd0291fd0e264a8338ded17f77fc0b8dc60bd 100644
(file)
--- a/
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
+++ b/
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
@@
-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)
|> 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
[account] = results["accounts"]
assert account["acct"] == "mike@osada.macgirvin.com"
end