aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-11-02 12:08:20 +0000
committerlain <lain@soykaf.club>2020-11-02 12:08:20 +0000
commit24ce3249736c96686c00a10abe47659579535259 (patch)
tree9da0943abf651c74032e199e1625cf326744ba61
parent9fbe9ef77436d6a9a176d264ee830300a2a37889 (diff)
parent4caad4e9101c34debfa90d2e89850d4125a471b3 (diff)
downloadpleroma-24ce3249736c96686c00a10abe47659579535259.tar.gz
Merge branch 'bugfix/poll_replies_count' into 'develop'
side_effects: Don’t increase_replies_count when it’s an Answer Closes #2274 See merge request pleroma/pleroma!3114
-rw-r--r--lib/pleroma/web/activity_pub/side_effects.ex2
-rw-r--r--test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex
index d552e91fc..bbff35c36 100644
--- a/lib/pleroma/web/activity_pub/side_effects.ex
+++ b/lib/pleroma/web/activity_pub/side_effects.ex
@@ -187,7 +187,7 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
{:ok, notifications} = Notification.create_notifications(activity, do_send: false)
{:ok, _user} = ActivityPub.increase_note_count_if_public(user, object)
- if in_reply_to = object.data["inReplyTo"] do
+ if in_reply_to = object.data["inReplyTo"] && object.data["type"] != "Answer" do
Object.increase_replies_count(in_reply_to)
end
diff --git a/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs
index 0f6605c3f..e7d85a2c5 100644
--- a/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs
+++ b/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs
@@ -27,6 +27,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnswerHandlingTest do
})
object = Object.normalize(activity)
+ assert object.data["repliesCount"] == nil
data =
File.read!("test/fixtures/mastodon-vote.json")
@@ -41,7 +42,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnswerHandlingTest do
assert answer_object.data["inReplyTo"] == object.data["id"]
new_object = Object.get_by_ap_id(object.data["id"])
- assert new_object.data["replies_count"] == object.data["replies_count"]
+ assert new_object.data["repliesCount"] == nil
assert Enum.any?(
new_object.data["oneOf"],