Get link to shared inbox from actor

master
Bob Mottram 2019-07-05 14:38:29 +01:00
parent cdddf40b26
commit f92ea581c6
1 changed files with 10 additions and 2 deletions

View File

@ -85,14 +85,22 @@ def getPersonBox(session,wfRequest: {},personCache: {},boxName='inbox') -> (str,
personUrl = getUserUrl(wfRequest) personUrl = getUserUrl(wfRequest)
if not personUrl: if not personUrl:
return None return None
print('**********personUrl: '+personUrl)
personJson = getPersonFromCache(personUrl,personCache) personJson = getPersonFromCache(personUrl,personCache)
if not personJson: if not personJson:
personJson = getJson(session,personUrl,asHeader,None) personJson = getJson(session,personUrl,asHeader,None)
if not personJson: if not personJson:
return None return None
boxJson=None
if not personJson.get(boxName): 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 return personPosts
personId=None personId=None
if personJson.get('id'): if personJson.get('id'):
personId=personJson['id'] personId=personJson['id']
@ -106,7 +114,7 @@ def getPersonBox(session,wfRequest: {},personCache: {},boxName='inbox') -> (str,
storePersonInCache(personUrl,personJson,personCache) storePersonInCache(personUrl,personJson,personCache)
return personJson[boxName],pubKeyId,pubKey,personId return boxJson,pubKeyId,pubKey,personId
def getPosts(session,outboxUrl: str,maxPosts: int,maxMentions: int, \ def getPosts(session,outboxUrl: str,maxPosts: int,maxMentions: int, \
maxEmoji: int,maxAttachments: int,federationList: [], \ maxEmoji: int,maxAttachments: int,federationList: [], \