Check if announce object is blocked

merge-requests/6/head
Bob Mottram 2020-02-05 11:46:05 +00:00
parent 19bd904f89
commit a8a90b9245
1 changed files with 7 additions and 2 deletions

View File

@ -2685,6 +2685,11 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str, \
if isBlocked(baseDir,nickname,domain,actorNickname,actorDomain): if isBlocked(baseDir,nickname,domain,actorNickname,actorDomain):
print('Announce download blocked actor: '+actorNickname+'@'+actorDomain) print('Announce download blocked actor: '+actorNickname+'@'+actorDomain)
return None 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']) print('Downloading Announce content for '+postJsonObject['object'])
announcedJson= \ announcedJson= \
getJson(session,postJsonObject['object'],asHeader, \ getJson(session,postJsonObject['object'],asHeader, \