mirror of https://gitlab.com/bashrc2/epicyon
Include post id in reject messages
parent
0f2c863e4e
commit
b75faf7ac8
4
inbox.py
4
inbox.py
|
@ -1128,12 +1128,16 @@ def validPostContent(messageJson: {},maxMentions: int) -> bool:
|
||||||
return False
|
return False
|
||||||
# check (rough) number of mentions
|
# check (rough) number of mentions
|
||||||
if estimateNumberOfMentions(messageJson['object']['content'])>maxMentions:
|
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'])
|
print('REJECT: Too many mentions in post - '+messageJson['object']['content'])
|
||||||
return False
|
return False
|
||||||
# check number of tags
|
# check number of tags
|
||||||
if messageJson['object'].get('tag'):
|
if messageJson['object'].get('tag'):
|
||||||
if isinstance(messageJson['object']['tag'], list):
|
if isinstance(messageJson['object']['tag'], list):
|
||||||
if len(messageJson['object']['tag'])>maxMentions*2:
|
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'])
|
print('REJECT: Too many tags in post - '+messageJson['object']['tag'])
|
||||||
return False
|
return False
|
||||||
print('ACCEPT: post content is valid')
|
print('ACCEPT: post content is valid')
|
||||||
|
|
Loading…
Reference in New Issue