Simulate webfinger for posts to shared inbox

master
Bob Mottram 2019-08-22 21:26:57 +01:00
parent 00d42a5b34
commit fc01d82998
1 changed files with 25 additions and 9 deletions

View File

@ -1174,14 +1174,16 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
if ':' not in toDomain:
toDomain=toDomain+':'+str(toPort)
if toNickname!='inbox':
if not sharedInbox:
handle=httpPrefix+'://'+toDomain+'/@'+toNickname
else:
handle=httpPrefix+'://'+toDomain+'/'+toNickname
sharedInboxUrl=handle
if debug:
print('DEBUG: handle - '+handle+' toPort '+str(toPort))
if not sharedInbox:
# lookup the inbox for the To handle
wfRequest=webfingerHandle(session,handle,httpPrefix,cachedWebfingers, \
domain,projectVersion)
@ -1189,6 +1191,20 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
if debug:
print('DEBUG: webfinger for '+handle+' failed')
return 1
else:
wfRequest={
"aliases": [
httpPrefix+'://'+toDomain+'/inbox'
],
"links": [
{
"href": httpPrefix+'://'+toDomain+'/inbox',
"rel": "self",
"type": "application/activity+json"
}
],
"subject": 'acct:inbox@'+toDomain
}
if not clientToServer:
postToBox='inbox'