Check the published date on downloaded announces

alt-html-css
Bob Mottram 2020-12-21 20:38:31 +00:00
parent ae7e0a8912
commit b257f90df2
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,7 @@ from session import postJsonString
from session import postImage
from webfinger import webfingerHandle
from httpsig import createSignedHeader
from utils import validPostDate
from utils import getFullDomain
from utils import getFollowersList
from utils import isEvil
@ -3817,6 +3818,12 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str,
if not announcedJson.get('content'):
rejectAnnounce(announceFilename)
return None
if not announcedJson.get('published'):
rejectAnnounce(announceFilename)
return None
if not validPostDate(announcedJson['published']):
rejectAnnounce(announceFilename)
return None
if isFiltered(baseDir, nickname, domain, announcedJson['content']):
rejectAnnounce(announceFilename)
return None