From e085f4ab381a61b3bc2e270a2cf41b5a705720ef Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 17 Aug 2019 10:36:20 +0200 Subject: [PATCH] Fix reply counter --- core/activitypub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/activitypub.py b/core/activitypub.py index 11eeecf..0e3ea85 100644 --- a/core/activitypub.py +++ b/core/activitypub.py @@ -39,6 +39,7 @@ from core.meta import flag from core.meta import inc from core.meta import upsert from core.tasks import Tasks +from croe.meta import by_type from utils import now logger = logging.getLogger(__name__) @@ -507,7 +508,8 @@ class MicroblogPubBackend(Backend): # It's a regular reply, try to increment the reply counter creply = DB.activities.find_one_and_update( - by_object_id(in_reply_to), inc(MetaKey.COUNT_REPLY, 1) + {**by_object_id(in_reply_to), **by_type(ap.ActivityType.CREATE)}, + inc(MetaKey.COUNT_REPLY, 1), ) if not creply: # Maybe it's the reply of a reply?