Additional announce block check

main
Bob Mottram 2020-01-18 10:39:51 +00:00
parent aff29e1f70
commit 2a01d5b566
1 changed files with 4 additions and 1 deletions

View File

@ -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)