diff --git a/acceptreject.py b/acceptreject.py index 712d9ef7a..d3f4c50cd 100644 --- a/acceptreject.py +++ b/acceptreject.py @@ -77,7 +77,8 @@ def _acceptFollow(baseDir: str, domain: str, messageJson: {}, if not messageJson['object'].get('type'): return if not messageJson['object']['type'] == 'Follow': - return + if not messageJson['object']['type'] == 'Join': + return if debug: print('DEBUG: receiving Follow activity') if not messageJson['object'].get('actor'): diff --git a/follow.py b/follow.py index 085c7aecb..3411a7d45 100644 --- a/follow.py +++ b/follow.py @@ -598,7 +598,8 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str, """Receives a follow request within the POST section of HTTPServer """ if not messageJson['type'].startswith('Follow'): - return False + if not messageJson['type'].startswith('Join'): + return False print('Receiving follow request') if not messageJson.get('actor'): if debug: @@ -1162,7 +1163,8 @@ def outboxUndoFollow(baseDir: str, messageJson: {}, debug: bool) -> None: if not messageJson['object'].get('type'): return if not messageJson['object']['type'] == 'Follow': - return + if not messageJson['object']['type'] == 'Join': + return if not messageJson['object'].get('object'): return if not messageJson['object'].get('actor'): diff --git a/inbox.py b/inbox.py index c213e0d22..d4b66c59e 100644 --- a/inbox.py +++ b/inbox.py @@ -275,7 +275,7 @@ def inboxMessageHasParams(messageJson: {}) -> bool: # param + ' ' + str(messageJson)) return False if not messageJson.get('to'): - allowedWithoutToParam = ['Like', 'Follow', 'Request', + allowedWithoutToParam = ['Like', 'Follow', 'Join', 'Request', 'Accept', 'Capability', 'Undo'] if messageJson['type'] not in allowedWithoutToParam: return False @@ -297,7 +297,7 @@ def inboxPermittedMessage(domain: str, messageJson: {}, if not urlPermitted(actor, federationList): return False - alwaysAllowedTypes = ('Follow', 'Like', 'Delete', 'Announce') + alwaysAllowedTypes = ('Follow', 'Join', 'Like', 'Delete', 'Announce') if messageJson['type'] not in alwaysAllowedTypes: if not messageJson.get('object'): return True @@ -693,7 +693,8 @@ def _receiveUndo(session, baseDir: str, httpPrefix: str, print('DEBUG: ' + messageJson['type'] + ' object within object is not a string') return False - if messageJson['object']['type'] == 'Follow': + if messageJson['object']['type'] == 'Follow' or \ + messageJson['object']['type'] == 'Join': return _receiveUndoFollow(session, baseDir, httpPrefix, port, messageJson, federationList, debug) diff --git a/posts.py b/posts.py index a0920284c..d44257bd2 100644 --- a/posts.py +++ b/posts.py @@ -2414,7 +2414,8 @@ def sendToNamedAddresses(session, baseDir: str, print('DEBUG: ' + 'no "to" field when sending to named addresses') if postJsonObject['object'].get('type'): - if postJsonObject['object']['type'] == 'Follow': + if postJsonObject['object']['type'] == 'Follow' or \ + postJsonObject['object']['type'] == 'Join': if isinstance(postJsonObject['object']['object'], str): if debug: print('DEBUG: "to" field assigned to Follow')