From a20003360a5645d23189c0f8c154d588c54d82f7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 6 Dec 2021 15:43:19 +0000 Subject: [PATCH] Separate public check --- posts.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/posts.py b/posts.py index 6feebc671..6de1433c0 100644 --- a/posts.py +++ b/posts.py @@ -1458,13 +1458,19 @@ def _createPostBase(baseDir: str, for ccRemoval in removeFromCC: toCC.remove(ccRemoval) - if inReplyTo and isPublic: - # If this is a public post then get the actor being - # replied to end ensure that it is within the CC list - replyActor = _getActorFromInReplyTo(inReplyTo) - if replyActor: - if replyActor not in toCC: - toCC.append(replyActor) + if inReplyTo: + isPublic = False + for recipient in toRecipients: + if recipient.endswith('#Public'): + isPublic = True + break + if isPublic: + # If this is a public post then get the actor being + # replied to end ensure that it is within the CC list + replyActor = _getActorFromInReplyTo(inReplyTo) + if replyActor: + if replyActor not in toCC: + toCC.append(replyActor) # the type of post to be made postObjectType = 'Note'