From f92ea581c6edd42d2f7e24ba00eb1f4e2c1de9c3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 5 Jul 2019 14:38:29 +0100 Subject: [PATCH] Get link to shared inbox from actor --- posts.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/posts.py b/posts.py index c599c24d..fb2792bd 100644 --- a/posts.py +++ b/posts.py @@ -85,14 +85,22 @@ def getPersonBox(session,wfRequest: {},personCache: {},boxName='inbox') -> (str, personUrl = getUserUrl(wfRequest) if not personUrl: return None - print('**********personUrl: '+personUrl) personJson = getPersonFromCache(personUrl,personCache) if not personJson: personJson = getJson(session,personUrl,asHeader,None) if not personJson: return None + boxJson=None if not personJson.get(boxName): + if personJson.get('endpoints'): + if personJson['endpoints'].get(boxName): + boxJson=personJson['endpoints'][boxName] + else: + boxJson=personJson[boxName] + + if not boxJson: return personPosts + personId=None if personJson.get('id'): personId=personJson['id'] @@ -106,7 +114,7 @@ def getPersonBox(session,wfRequest: {},personCache: {},boxName='inbox') -> (str, storePersonInCache(personUrl,personJson,personCache) - return personJson[boxName],pubKeyId,pubKey,personId + return boxJson,pubKeyId,pubKey,personId def getPosts(session,outboxUrl: str,maxPosts: int,maxMentions: int, \ maxEmoji: int,maxAttachments: int,federationList: [], \