From fb3192750219b6b06af89aa63c34dbbd3a830073 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 17 Jul 2019 12:24:11 +0100 Subject: [PATCH] Extra follow checks --- inbox.py | 2 ++ tests.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/inbox.py b/inbox.py index dac7ff624..6149b3a46 100644 --- a/inbox.py +++ b/inbox.py @@ -425,6 +425,8 @@ def receiveUndo(session,baseDir: str,httpPrefix: str, \ """ if not messageJson['type'].startswith('Undo'): return False + if debug: + print('DEBUG: Undo activity received') if not messageJson.get('actor'): if debug: print('DEBUG: follow request has no actor') diff --git a/tests.py b/tests.py index d9080ba8f..76186b413 100644 --- a/tests.py +++ b/tests.py @@ -1080,8 +1080,10 @@ def testClientToServer(): True) for t in range(10): if os.path.isfile(bobDir+'/accounts/bob@'+bobDomain+'/followers.txt'): - if os.path.isfile(aliceDir+'/accounts/alice@'+aliceDomain+'/following.txt'): - break + if 'alice@'+aliceDomain+':'+alicePort in open(bobDir+'/accounts/bob@'+bobDomain+'/followers.txt').read(): + if os.path.isfile(aliceDir+'/accounts/alice@'+aliceDomain+'/following.txt'): + if 'bob@'+bobDomain+':'+bobPort in open(aliceDir+'/accounts/alice@'+aliceDomain+'/following.txt').read(): + break time.sleep(1) assert os.path.isfile(bobDir+'/accounts/bob@'+bobDomain+'/followers.txt')