From 2b318435b27963a519f77112a29effcb20cbba43 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 30 Sep 2019 20:39:48 +0100 Subject: [PATCH] Tidying --- inbox.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/inbox.py b/inbox.py index 287ff2cfe..118e9408d 100644 --- a/inbox.py +++ b/inbox.py @@ -1159,13 +1159,18 @@ def obtainReplyToAvatar(baseDir: str,personCache: {},postJsonObject: {}) -> None """Tries to obtain the actor for the person being replied to so that their avatar can later be shown """ - lookupActor=None - if postJsonObject.get('object'): - if isinstance(postJsonObject['object'], dict): - if postJsonObject['object'].get('inReplyTo'): - lookupActor=postJsonObject['object']['inReplyTo'] - if lookupActor: - getPersonFromCache(baseDir,lookupActor,personCache) + if not postJsonObject.get('object'): + return + + if not isinstance(postJsonObject['object'], dict): + return + + if not postJsonObject['object'].get('inReplyTo'): + return + + lookupActor=postJsonObject['object']['inReplyTo'] + if lookupActor: + getPersonFromCache(baseDir,lookupActor,personCache) def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \ baseDir: str,httpPrefix: str,sendThreads: [], \