Receiving follow accept/reject from single user instances

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

View File

@ -189,8 +189,7 @@ def receiveAcceptReject(session,baseDir: str, \
'/channel/' not in messageJson['actor'] and \ '/channel/' not in messageJson['actor'] and \
'/profile/' not in messageJson['actor']: '/profile/' not in messageJson['actor']:
if debug: if debug:
print('DEBUG: "users" or "profile" missing from actor in '+messageJson['type']) print('DEBUG: "users" or "profile" missing from actor in '+messageJson['type']+'. Assuming single user instance.')
return False
domain,tempPort=getDomainFromActor(messageJson['actor']) domain,tempPort=getDomainFromActor(messageJson['actor'])
if not domainPermitted(domain,federationList): if not domainPermitted(domain,federationList):
if debug: if debug:
@ -198,9 +197,9 @@ def receiveAcceptReject(session,baseDir: str, \
return False return False
nickname=getNicknameFromActor(messageJson['actor']) nickname=getNicknameFromActor(messageJson['actor'])
if not nickname: if not nickname:
nickname='dev'
if debug: if debug:
print('DEBUG: '+messageJson['type']+' does not contain a nickname') print('DEBUG: '+messageJson['type']+' does not contain a nickname. Assuming single user instance.')
return False
handle=nickname.lower()+'@'+domain.lower() handle=nickname.lower()+'@'+domain.lower()
# receive follow accept # receive follow accept
acceptFollow(baseDir,domain,messageJson,federationList,debug) acceptFollow(baseDir,domain,messageJson,federationList,debug)

View File

@ -1819,7 +1819,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
actorNickname=getNicknameFromActor(postJsonObject['actor']) actorNickname=getNicknameFromActor(postJsonObject['actor'])
if not actorNickname: if not actorNickname:
# single user instance # single user instance
actorNickname='owner' actorNickname='dev'
actorDomain,actorPort=getDomainFromActor(postJsonObject['actor']) actorDomain,actorPort=getDomainFromActor(postJsonObject['actor'])
messageId='' messageId=''
if postJsonObject.get('id'): if postJsonObject.get('id'):