From 2a01d5b5660c273a81cf9d6f5ae379eeebace554 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 18 Jan 2020 10:39:51 +0000 Subject: [PATCH] Additional announce block check --- posts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 51f754ff..7fde32f8 100644 --- a/posts.py +++ b/posts.py @@ -2678,12 +2678,15 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str, \ if postJsonObject: return postJsonObject else: - print('Downloading Announce content for '+postJsonObject['object']) asHeader={'Accept': 'application/activity+json; profile="https://www.w3.org/ns/activitystreams"'} if '/channel/' in postJsonObject['actor']: asHeader={'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'} actorNickname=getNicknameFromActor(postJsonObject['actor']) actorDomain,actorPort=getDomainFromActor(postJsonObject['actor']) + if isBlocked(baseDir,nickname,domain,actorNickname,actorDomain): + print('Announce download blocked actor: '+actorNickname+'@'+actorDomain) + return None + print('Downloading Announce content for '+postJsonObject['object']) announcedJson= \ getJson(session,postJsonObject['object'],asHeader, \ None,projectVersion,httpPrefix,domain)