Setting shared inbox actor to @domain@domain

master
Bob Mottram 2019-08-23 15:08:10 +01:00
parent 377940a31f
commit 5303be3942
2 changed files with 10 additions and 3 deletions

View File

@ -239,6 +239,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str, \
sharedInboxItem=False sharedInboxItem=False
if nickname=='inbox': if nickname=='inbox':
nickname=originalDomain
sharedInboxItem=True sharedInboxItem=True
newQueueItem = { newQueueItem = {

View File

@ -948,6 +948,11 @@ def sendPost(projectVersion: str, \
""" """
withDigest=True withDigest=True
if toNickname=='inbox':
# shared inbox actor on @domain@domain
toNickname=toDomain
toDomainOriginal=toDomain
if toPort: if toPort:
if toPort!=80 and toPort!=443: if toPort!=80 and toPort!=443:
if ':' not in toDomain: if ':' not in toDomain:
@ -979,7 +984,7 @@ def sendPost(projectVersion: str, \
return 2 return 2
else: else:
if noOfFollowersOnDomain(baseDir,handle,toDomain)>1 and sharedInbox: if noOfFollowersOnDomain(baseDir,handle,toDomain)>1 and sharedInbox:
inboxUrl=sharedInbox inboxUrl=sharedInbox.replace('/inbox','/'+toDomainOriginal)
if not inboxUrl: if not inboxUrl:
return 3 return 3
@ -1003,7 +1008,7 @@ def sendPost(projectVersion: str, \
if toDomain not in inboxUrl: if toDomain not in inboxUrl:
return 7 return 7
postPath=inboxUrl.split(toDomain)[1] postPath=inboxUrl.split(toDomain,1)[1]
# convert json to string so that there are no # convert json to string so that there are no
# subsequent conversions after creating message body digest # subsequent conversions after creating message body digest
@ -1174,6 +1179,7 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
toNickname=toDomain toNickname=toDomain
sharedInbox=True sharedInbox=True
toDomainOriginal=toDomain
if toPort: if toPort:
if toPort!=80 and toPort!=443: if toPort!=80 and toPort!=443:
if ':' not in toDomain: if ':' not in toDomain:
@ -1208,7 +1214,7 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
return 2 return 2
else: else:
if sharedInbox and sharedInboxUrl: if sharedInbox and sharedInboxUrl:
inboxUrl=sharedInboxUrl inboxUrl=sharedInboxUrl.replace('/inbox','/'+toDomainOriginal)
if not inboxUrl: if not inboxUrl:
if debug: if debug: