From b75faf7ac8567d068cf4ea01eeb0d52c0ed95043 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 30 Sep 2019 11:37:34 +0100 Subject: [PATCH] Include post id in reject messages --- inbox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inbox.py b/inbox.py index d9ea5eee3..7eb1913b3 100644 --- a/inbox.py +++ b/inbox.py @@ -1128,12 +1128,16 @@ def validPostContent(messageJson: {},maxMentions: int) -> bool: return False # check (rough) number of mentions if estimateNumberOfMentions(messageJson['object']['content'])>maxMentions: + if messageJson['object'].get('id'): + print('REJECT: '+messageJson['object']['id']) print('REJECT: Too many mentions in post - '+messageJson['object']['content']) return False # check number of tags if messageJson['object'].get('tag'): if isinstance(messageJson['object']['tag'], list): if len(messageJson['object']['tag'])>maxMentions*2: + if messageJson['object'].get('id'): + print('REJECT: '+messageJson['object']['id']) print('REJECT: Too many tags in post - '+messageJson['object']['tag']) return False print('ACCEPT: post content is valid')