Changing properties of the shared inbox

master
Bob Mottram 2019-08-23 20:37:40 +01:00
parent f008af1776
commit fc925e7705
2 changed files with 24 additions and 7 deletions

View File

@ -826,6 +826,9 @@ if args.actor:
asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'}
personUrl = getUserUrl(wfRequest)
if nickname==domain:
personUrl=personUrl.replace('/users/','/actor/')
#print('personUrl: '+personUrl)
personJson = getJson(session,personUrl,asHeader,None,__version__,httpPrefix,domain)
if personJson:
pprint(personJson)

View File

@ -137,11 +137,25 @@ def createPersonBase(baseDir: str,nickname: str,domain: str,port: int, \
storeWebfingerEndpoint(nickname,domain,port,baseDir,webfingerEndpoint)
handle=nickname.lower()+'@'+domain.lower()
originalDomain=domain
if port:
if port!=80 and port!=443:
if ':' not in domain:
domain=domain+':'+str(port)
personType='Person'
approveFollowers=False
personName=nickname
inboxStr=httpPrefix+'://'+domain+'/users/'+nickname+'/inbox'
personId=httpPrefix+'://'+domain+'/users/'+nickname
if nickname=='inbox':
# shared inbox
inboxStr=httpPrefix+'://'+domain+'/actor/inbox'
personId=httpPrefix+'://'+domain+'/actor'
personName=originalDomain
approveFollowers=True
personType='Application'
newPerson = {'@context': ['https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1',
{'Emoji': 'toot:Emoji',
@ -171,15 +185,15 @@ def createPersonBase(baseDir: str,nickname: str,domain: str,port: int, \
'icon': {'mediaType': 'image/png',
'type': 'Image',
'url': httpPrefix+'://'+domain+'/users/'+nickname+'/avatar.png'},
'id': httpPrefix+'://'+domain+'/users/'+nickname,
'id': personId,
'image': {'mediaType': 'image/png',
'type': 'Image',
'url': httpPrefix+'://'+domain+'/users/'+nickname+'/image.png'},
'inbox': httpPrefix+'://'+domain+'/users/'+nickname+'/inbox',
'manuallyApprovesFollowers': False,
'name': nickname,
'inbox': inboxStr,
'manuallyApprovesFollowers': approveFollowers,
'name': personName,
'outbox': httpPrefix+'://'+domain+'/users/'+nickname+'/outbox',
'preferredUsername': nickname,
'preferredUsername': personName,
'summary': '',
'publicKey': {
'id': httpPrefix+'://'+domain+'/users/'+nickname+'#main-key',
@ -187,8 +201,8 @@ def createPersonBase(baseDir: str,nickname: str,domain: str,port: int, \
'publicKeyPem': publicKeyPem
},
'tag': [],
'type': 'Person',
'url': httpPrefix+'://'+domain+'/@'+nickname
'type': personType,
'url': httpPrefix+'://'+domain+'/@'+personName
}
if saveToFile: