From a8a90b9245f8492eabaf2bf9c787aff166efbaa9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 5 Feb 2020 11:46:05 +0000 Subject: [PATCH] Check if announce object is blocked --- posts.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/posts.py b/posts.py index a2c2573f8..c5f3462a5 100644 --- a/posts.py +++ b/posts.py @@ -1848,7 +1848,7 @@ def sendToFollowers(session,baseDir: str, \ postJsonObject['object']['type']=='Service': print('Sending profile update to shared inbox of '+toDomain) toNickname='inbox' - + if debug: print('DEBUG: Sending from '+nickname+'@'+domain+ \ ' to '+toNickname+'@'+toDomain) @@ -1883,7 +1883,7 @@ def sendToFollowers(session,baseDir: str, \ federationList, \ sendThreads,postLog,cachedWebfingers, \ personCache,debug,projectVersion) - + time.sleep(4) if debug: @@ -2685,6 +2685,11 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str, \ if isBlocked(baseDir,nickname,domain,actorNickname,actorDomain): print('Announce download blocked actor: '+actorNickname+'@'+actorDomain) return None + objectNickname=getNicknameFromActor(postJsonObject['object']) + objectDomain,objectPort=getDomainFromActor(postJsonObject['object']) + if isBlocked(baseDir,nickname,domain,objectNickname,objectDomain): + print('Announce download blocked object: '+objectNickname+'@'+objectDomain) + return None print('Downloading Announce content for '+postJsonObject['object']) announcedJson= \ getJson(session,postJsonObject['object'],asHeader, \