Check that announced object is not blocked

merge-requests/30/head
Bob Mottram 2021-08-23 13:30:16 +01:00
parent 047ba3f174
commit 6433e1e89f
1 changed files with 10 additions and 0 deletions

View File

@ -1338,6 +1338,16 @@ def _receiveAnnounce(recentPostsCache: {},
actorNickname + '@' + actorDomain) actorNickname + '@' + actorDomain)
return False return False
# also check the actor for the url being announced
announcedActorNickname = getNicknameFromActor(messageJson['object'])
announcedActorDomain, announcedActorPort = \
getDomainFromActor(messageJson['object'])
if isBlocked(baseDir, nickname, domain,
announcedActorNickname, announcedActorDomain):
print('Receive announce blocked for actor: ' +
announcedActorNickname + '@' + announcedActorDomain)
return False
# is this post in the outbox of the person? # is this post in the outbox of the person?
postFilename = locatePost(baseDir, nickname, domain, postFilename = locatePost(baseDir, nickname, domain,
messageJson['object']) messageJson['object'])