diff --git a/inbox.py b/inbox.py index e3bd55bc..22670a5a 100644 --- a/inbox.py +++ b/inbox.py @@ -1095,7 +1095,26 @@ def populateReplies(baseDir :str,httpPrefix :str,domain :str, \ repliesFile.write(messageId+'\n') repliesFile.close() return True - + +def validPostContent(messageJson: {}) -> bool: + """Is the content of a received post valid? + """ + if not messageJson.get('object'): + return True + if not isinstance(messageJson['object'], dict): + return True + if not messageJson['object'].get('content'): + return True + invalidStrings=['