From 28d5dd15a6fa794aa39fd68a99edca6b8b9b4d88 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2019 18:05:22 +0100 Subject: [PATCH] Add a to field on follows if it is missing --- follow.py | 2 ++ inbox.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/follow.py b/follow.py index cc4f6985..f3258b7f 100644 --- a/follow.py +++ b/follow.py @@ -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: diff --git a/inbox.py b/inbox.py index ee4a2869..eb1db990 100644 --- a/inbox.py +++ b/inbox.py @@ -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