From d9bc4d72aaf59eb56522b518ca0fa12eef3ada36 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 20 Mar 2021 12:06:34 +0000 Subject: [PATCH] To field can be added for multiple activities --- daemon.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/daemon.py b/daemon.py index 219f2ed28..ee93178ff 100644 --- a/daemon.py +++ b/daemon.py @@ -1260,15 +1260,10 @@ class PubServer(BaseHTTPRequestHandler): originalMessageJson = messageJson.copy() - # For follow activities add a 'to' field, which is a copy - # of the object field - messageJson, toFieldExists = \ - addToField('Follow', messageJson, self.server.debug) - - # For like activities add a 'to' field, which is a copy of - # the actor within the object field - messageJson, toFieldExists = \ - addToField('Like', messageJson, self.server.debug) + addToFieldTypes = ('Follow', 'Like', 'Add', 'Remove') + for addToType in addToFieldTypes: + messageJson, toFieldExists = \ + addToField(addToType, messageJson, self.server.debug) beginSaveTime = time.time() # save the json for later queue processing