main
Bob Mottram 2023-10-25 21:11:24 +01:00
parent f94bd588f5
commit aed024f21d
1 changed files with 15 additions and 20 deletions

View File

@ -405,31 +405,26 @@ def get_person_box(signing_priv_key_pem: str, origin_domain: str,
if person_json['icon'].get('url'):
avatar_url = remove_html(person_json['icon']['url'])
display_name = None
possible_display_name = None
if person_json.get('name'):
display_name = person_json['name']
if dangerous_markup(person_json['name'], False, []):
display_name = '*ADVERSARY*'
elif is_filtered(base_dir,
nickname, domain,
display_name, 'en'):
display_name = '*FILTERED*'
# have they moved?
if person_json.get('movedTo'):
display_name += ''
possible_display_name = person_json['name']
if person_json.get('nameMap'):
if isinstance(person_json['nameMap'], dict):
if system_language in person_json['nameMap']:
if isinstance(person_json['nameMap'][system_language], str):
display_name = person_json['nameMap'][system_language]
if dangerous_markup(display_name, False, []):
display_name = '*ADVERSARY*'
elif is_filtered(base_dir,
nickname, domain,
display_name, 'en'):
display_name = '*FILTERED*'
# have they moved?
if person_json.get('movedTo'):
display_name += ''
possible_display_name = \
person_json['nameMap'][system_language]
if possible_display_name:
display_name = possible_display_name
if dangerous_markup(possible_display_name, False, []):
display_name = '*ADVERSARY*'
elif is_filtered(base_dir,
nickname, domain,
possible_display_name, 'en'):
display_name = '*FILTERED*'
# have they moved?
if person_json.get('movedTo'):
display_name += ''
store_person_in_cache(base_dir, person_url, person_json,
person_cache, True)