Add a to field on follows if it is missing

master
Bob Mottram 2019-08-15 18:05:22 +01:00
parent 55fa512d54
commit 28d5dd15a6
2 changed files with 5 additions and 1 deletions

View File

@ -363,6 +363,8 @@ def receiveFollowRequest(session,baseDir: str,httpPrefix: str, \
if debug:
print('DEBUG: follow request does not contain a nickname')
return False
if not messageJson.get('to'):
messageJson['to']=messageJson['object']
handle=nickname.lower()+'@'+domain.lower()
if '/users/' not in messageJson['object']:
if debug:

View File

@ -445,7 +445,9 @@ def receiveUndoFollow(session,baseDir: str,httpPrefix: str, \
if debug:
print('DEBUG: actors do not match')
return False
if not messageJson['object'].get('to'):
messageJson['object']['to']=messageJson['object']['object']
nicknameFollower=getNicknameFromActor(messageJson['object']['actor'])
domainFollower,portFollower=getDomainFromActor(messageJson['object']['actor'])
domainFollowerFull=domainFollower