Receiving follow requests from single user instances

main2
Bob Mottram 2019-10-21 13:27:47 +01:00
parent 63af111081
commit a29af6581e
2 changed files with 4 additions and 2 deletions

View File

@ -197,6 +197,7 @@ def receiveAcceptReject(session,baseDir: str, \
return False return False
nickname=getNicknameFromActor(messageJson['actor']) nickname=getNicknameFromActor(messageJson['actor'])
if not nickname: if not nickname:
# single user instance
nickname='dev' nickname='dev'
if debug: if debug:
print('DEBUG: '+messageJson['type']+' does not contain a nickname. Assuming single user instance.') print('DEBUG: '+messageJson['type']+' does not contain a nickname. Assuming single user instance.')

View File

@ -459,9 +459,10 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
return False return False
nickname=getNicknameFromActor(messageJson['actor']) nickname=getNicknameFromActor(messageJson['actor'])
if not nickname: if not nickname:
# single user instance
nickname='dev'
if debug: if debug:
print('DEBUG: follow request does not contain a nickname') print('DEBUG: follow request does not contain a nickname. Assuming single user instance.')
return False
if not messageJson.get('to'): if not messageJson.get('to'):
messageJson['to']=messageJson['object'] messageJson['to']=messageJson['object']
handle=nickname.lower()+'@'+domain.lower() handle=nickname.lower()+'@'+domain.lower()