mirror of https://gitlab.com/bashrc2/epicyon
Simulate webfinger for posts to shared inbox
parent
00d42a5b34
commit
fc01d82998
32
posts.py
32
posts.py
|
@ -1174,21 +1174,37 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
|
||||||
if ':' not in toDomain:
|
if ':' not in toDomain:
|
||||||
toDomain=toDomain+':'+str(toPort)
|
toDomain=toDomain+':'+str(toPort)
|
||||||
|
|
||||||
if toNickname!='inbox':
|
if not sharedInbox:
|
||||||
handle=httpPrefix+'://'+toDomain+'/@'+toNickname
|
handle=httpPrefix+'://'+toDomain+'/@'+toNickname
|
||||||
else:
|
else:
|
||||||
handle=httpPrefix+'://'+toDomain+'/'+toNickname
|
handle=httpPrefix+'://'+toDomain+'/'+toNickname
|
||||||
|
sharedInboxUrl=handle
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: handle - '+handle+' toPort '+str(toPort))
|
print('DEBUG: handle - '+handle+' toPort '+str(toPort))
|
||||||
|
|
||||||
# lookup the inbox for the To handle
|
if not sharedInbox:
|
||||||
wfRequest=webfingerHandle(session,handle,httpPrefix,cachedWebfingers, \
|
# lookup the inbox for the To handle
|
||||||
domain,projectVersion)
|
wfRequest=webfingerHandle(session,handle,httpPrefix,cachedWebfingers, \
|
||||||
if not wfRequest:
|
domain,projectVersion)
|
||||||
if debug:
|
if not wfRequest:
|
||||||
print('DEBUG: webfinger for '+handle+' failed')
|
if debug:
|
||||||
return 1
|
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:
|
if not clientToServer:
|
||||||
postToBox='inbox'
|
postToBox='inbox'
|
||||||
|
|
Loading…
Reference in New Issue