From 0941c66f7c89fce81a5d395d1e4fc89669462272 Mon Sep 17 00:00:00 2001 From: kaniini Date: Sun, 18 Nov 2018 14:49:54 +0000 Subject: [PATCH] actor: implement loop breaking for follow handshake --- relay/actor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay/actor.py b/relay/actor.py index 28d83ea..8b55e74 100644 --- a/relay/actor.py +++ b/relay/actor.py @@ -210,6 +210,9 @@ async def handle_follow(actor, data, request): following += [inbox] DATABASE['relay-list'] = following + if data['object'].endswith('/actor'): + asyncio.ensure_future(follow_remote_actor(actor['id'])) + message = { "@context": "https://www.w3.org/ns/activitystreams", "type": "Accept", @@ -229,9 +232,6 @@ async def handle_follow(actor, data, request): asyncio.ensure_future(push_message_to_actor(actor, message, 'https://{}/actor#main-key'.format(request.host))) - if data['object'].endswith('/actor'): - asyncio.ensure_future(follow_remote_actor(actor['id'])) - async def handle_undo(actor, data, request): global DATABASE