From 5b35225532bf18422d0b7e3683bd811f756244b0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 1 Oct 2019 15:11:15 +0100 Subject: [PATCH] Handle unwrapped posts --- inbox.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inbox.py b/inbox.py index 58440aa90..095c215de 100644 --- a/inbox.py +++ b/inbox.py @@ -989,10 +989,13 @@ def receiveAnnounce(session,handle: str,baseDir: str, \ # Try to obtain the actor for this person # so that their avatar can be shown lookupActor=None - if postJsonObject.get('object'): - if isinstance(postJsonObject['object'], dict): - if postJsonObject['object'].get('attributedTo'): - lookupActor=postJsonObject['object']['attributedTo'] + if postJsonObject.get('attributedTo'): + lookupActor=postJsonObject['attributedTo'] + else: + if postJsonObject.get('object'): + if isinstance(postJsonObject['object'], dict): + if postJsonObject['object'].get('attributedTo'): + lookupActor=postJsonObject['object']['attributedTo'] if lookupActor: if '/users/' in lookupActor: if '/statuses/' in lookupActor: