From 45a28448552d50b6356a05e3b5b7a7082780ad81 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Nov 2019 12:46:51 +0000 Subject: [PATCH] Tidying --- posts.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/posts.py b/posts.py index cc267f9d..fb4e1d83 100644 --- a/posts.py +++ b/posts.py @@ -756,15 +756,13 @@ def postIsAddressedToFollowers(baseDir: str, ccList=[] if postJsonObject['type']!='Update' and \ isinstance(postJsonObject['object'], dict): - if not postJsonObject['object'].get('to'): - return False - toList=postJsonObject['object']['to'] + if postJsonObject['object'].get('to'): + toList=postJsonObject['object']['to'] if postJsonObject['object'].get('cc'): ccList=postJsonObject['object']['cc'] else: - if not postJsonObject.get('to'): - return False - toList=postJsonObject['to'] + if postJsonObject.get('to'): + toList=postJsonObject['to'] if postJsonObject.get('cc'): ccList=postJsonObject['cc'] @@ -774,9 +772,8 @@ def postIsAddressedToFollowers(baseDir: str, addressedToFollowers=False if followersUrl in toList: addressedToFollowers=True - if not addressedToFollowers: - if followersUrl in ccList: - addressedToFollowers=True + elif followersUrl in ccList: + addressedToFollowers=True return addressedToFollowers def postIsAddressedToPublic(baseDir: str,postJsonObject: {}) -> bool: