forked from indymedia/epicyon
More content warning validation
parent
8d6b8f98b0
commit
a484936793
10
inbox.py
10
inbox.py
|
@ -50,6 +50,7 @@ from filters import isFiltered
|
|||
from announce import updateAnnounceCollection
|
||||
from announce import undoAnnounceCollectionEntry
|
||||
from httpsig import messageContentDigest
|
||||
from posts import validContentWarning
|
||||
from posts import downloadAnnounce
|
||||
from posts import isDM
|
||||
from posts import isReply
|
||||
|
@ -1708,6 +1709,15 @@ def validPostContent(baseDir: str, nickname: str, domain: str,
|
|||
if 'Z' not in messageJson['object']['published']:
|
||||
return False
|
||||
|
||||
if messageJson['object'].get('summary'):
|
||||
summary = messageJson['object']['summary']
|
||||
if not isinstance(summary, str):
|
||||
print('WARN: content warning is not a string')
|
||||
return False
|
||||
if summary != validContentWarning(summary):
|
||||
print('WARN: invalid content warning ' + summary)
|
||||
return False
|
||||
|
||||
if isGitPatch(baseDir, nickname, domain,
|
||||
messageJson['object']['type'],
|
||||
messageJson['object']['summary'],
|
||||
|
|
Loading…
Reference in New Issue