From 625a5af933bd58f5a72a74e060c50ecaef62450a Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 29 Aug 2024 16:45:45 -0400 Subject: [PATCH] Improve side effects logic for bumping replies count The previous fix was good, but let's avoid playing code golf. --- lib/pleroma/web/activity_pub/side_effects.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/activity_pub/side_effects.ex b/lib/pleroma/web/activity_pub/side_effects.ex index d6d403671..ab62d747f 100644 --- a/lib/pleroma/web/activity_pub/side_effects.ex +++ b/lib/pleroma/web/activity_pub/side_effects.ex @@ -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