Extra debug on follow accept

main
Bob Mottram 2019-11-12 14:18:23 +00:00
parent aaf5c1a77f
commit fd8f696f2e
1 changed files with 8 additions and 2 deletions

View File

@ -86,13 +86,17 @@ def acceptFollow(baseDir: str,domain : str,messageJson: {}, \
return return
if not messageJson['object'].get('type'): if not messageJson['object'].get('type'):
return return
if not messageJson['object']['type']=='Follow':
return
if debug:
print('DEBUG: receiving Follow activity')
if not messageJson['object'].get('actor'): if not messageJson['object'].get('actor'):
print('DEBUG: no actor in Follow activity')
return return
# no, this isn't a mistake # no, this isn't a mistake
if not messageJson['object'].get('object'): if not messageJson['object'].get('object'):
print('DEBUG: no object within Follow activity')
return return
if not messageJson['object']['type']=='Follow':
return
if not messageJson.get('to'): if not messageJson.get('to'):
if debug: if debug:
print('DEBUG: No "to" parameter in follow Accept') print('DEBUG: No "to" parameter in follow Accept')
@ -132,12 +136,14 @@ def acceptFollow(baseDir: str,domain : str,messageJson: {}, \
followedActor=messageJson['object']['object'] followedActor=messageJson['object']['object']
followedDomain,port=getDomainFromActor(followedActor) followedDomain,port=getDomainFromActor(followedActor)
if not followedDomain: if not followedDomain:
print('DEBUG: no domain found within Follow activity object '+followedActor)
return return
followedDomainFull=followedDomain followedDomainFull=followedDomain
if port: if port:
followedDomainFull=followedDomain+':'+str(port) followedDomainFull=followedDomain+':'+str(port)
followedNickname=getNicknameFromActor(followedActor) followedNickname=getNicknameFromActor(followedActor)
if not followedNickname: if not followedNickname:
print('DEBUG: no nickname found within Follow activity object '+followedActor)
return return
acceptedDomainFull=acceptedDomain acceptedDomainFull=acceptedDomain