Show bot status on profile screens

main
bashrc 2026-02-02 14:55:07 +00:00
parent 738286c01b
commit 68dc6ecab0
1 changed files with 17 additions and 0 deletions

View File

@ -23,6 +23,7 @@ from textmode import text_mode_removals
from unicodetext import uninvert_text
from unicodetext import standardize_text
from occupation import get_occupation_name
from utils import get_actor_type
from utils import get_mutuals_of_person
from utils import get_person_icon
from utils import replace_strings
@ -347,6 +348,12 @@ def html_profile_after_search(authorized: bool,
if locked_account:
display_name += '🔒'
# is this a bot account?
if profile_json.get('type'):
if isinstance(profile_json['type'], str):
if profile_json['type'] != 'Person':
display_name = '[' + translate['Bot'] + '] ' + display_name
pronouns = get_pronouns(profile_json)
discord = get_discord(profile_json)
art_site_url = get_art_site_url(profile_json)
@ -1175,6 +1182,13 @@ def html_profile(signing_priv_key_pem: str,
add_emoji_to_display_name(session, base_dir, http_prefix,
nickname, domain,
display_name, False, translate)
# is this a bot account?
if profile_json.get('type'):
if isinstance(profile_json['type'], str):
if profile_json['type'] != 'Person':
display_name = '[' + translate['Bot'] + '] ' + display_name
domain_full = get_full_domain(domain, port)
profile_status = get_actor_status(profile_json)
if profile_status:
@ -3909,6 +3923,9 @@ def _individual_follow_as_html(signing_priv_key_pem: str,
add_emoji_to_display_name(None, base_dir, http_prefix,
actor_nickname, domain,
display_name, False, translate)
actor_type = get_actor_type(base_dir, follow_url, person_cache)
if actor_type != 'Person':
display_name = '[' + translate['Bot'] + '] ' + display_name
title_str = display_name
if offline: