Don't allow alt-text descriptions of images to be too small

main
Bob Mottram 2024-03-23 20:18:28 +00:00
parent d7125c1891
commit 565c6dac2d
1 changed files with 6 additions and 0 deletions

View File

@ -4504,6 +4504,12 @@ def disallow_announce(content: str, attachment: [], capabilities: {}) -> bool:
if not item.get('name'):
# no image description
return True
image_description = item['name']
if not isinstance(image_description, str):
continue
if len(image_description) < 5:
# not enough description
return True
return False