Improve side effects logic for bumping replies count

The previous fix was good, but let's avoid playing code golf.
This commit is contained in:
Mark Felder 2024-08-29 16:45:45 -04:00
parent 62856ab18f
commit 625a5af933

View file

@ -209,8 +209,10 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
{:ok, _user} = ActivityPub.increase_note_count_if_public(user, object)
{:ok, _user} = ActivityPub.update_last_status_at_if_public(user, object)
if in_reply_to = object.data["type"] != "Answer" && object.data["inReplyTo"] do
Object.increase_replies_count(in_reply_to)
reply_to_ap_id = object.data["inReplyTo"]
if object.data["type"] not in ["Answer"] and is_binary(reply_to_ap_id) do
Object.increase_replies_count(reply_to_ap_id)
end
if quote_url = object.data["quoteUrl"] do