From 0574df273c06f8ce5dea10f9978c7dd5bfea558d Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 22 Apr 2018 10:01:10 +0200 Subject: [PATCH] Small cleanup. --- lib/pleroma/formatter.ex | 7 +++++-- lib/pleroma/web/common_api/common_api.ex | 1 - test/web/activity_pub/transmogrifier_test.exs | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index a708a275e..456416fbd 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -169,8 +169,11 @@ def add_links({subs, text}) do subs ++ Enum.map(links, fn {uuid, url} -> {:safe, link} = Phoenix.HTML.Link.link(url, to: url) - link = link - |> IO.iodata_to_binary + + link = + link + |> IO.iodata_to_binary() + {uuid, link} end) diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 21225c3b7..2c4b591d4 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -103,7 +103,6 @@ def post(user, %{"status" => status} = data) do additional: %{"cc" => cc} }) - User.increase_note_count(user) res end end diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 3dab59746..eb093262f 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -89,6 +89,10 @@ test "it works for incoming notices" do "tag:mastodon.example.org,2018-02-12:objectId=20:objectType=Conversation" assert object["sensitive"] == true + + user = User.get_by_ap_id(object["actor"]) + + assert user.info["note_count"] == 1 end test "it works for incoming notices with hashtags" do