mirror of https://gitlab.com/bashrc2/epicyon
Common chatbot nicknames
parent
a86884d8a3
commit
e706ec5648
6
utils.py
6
utils.py
|
|
@ -4161,6 +4161,12 @@ def load_instance_software(base_dir: str) -> []:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
def chatbot_nicknames() -> []:
|
||||||
|
"""Returns a list of common chatbot usernames/nicknames
|
||||||
|
"""
|
||||||
|
return ('gemini', 'chatgpt')
|
||||||
|
|
||||||
|
|
||||||
def get_event_categories() -> []:
|
def get_event_categories() -> []:
|
||||||
"""Returns event categories
|
"""Returns event categories
|
||||||
https://codeberg.org/fediverse/fep/src/branch/main/fep/8a8e/fep-8a8e.md
|
https://codeberg.org/fediverse/fep/src/branch/main/fep/8a8e/fep-8a8e.md
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ from textmode import text_mode_removals
|
||||||
from quote import get_quote_toot_url
|
from quote import get_quote_toot_url
|
||||||
from timeFunctions import date_from_string_format
|
from timeFunctions import date_from_string_format
|
||||||
from timeFunctions import convert_published_to_local_timezone
|
from timeFunctions import convert_published_to_local_timezone
|
||||||
|
from utils import chatbot_nicknames
|
||||||
from utils import get_mutuals_of_person
|
from utils import get_mutuals_of_person
|
||||||
from utils import save_json
|
from utils import save_json
|
||||||
from utils import remove_header_tags
|
from utils import remove_header_tags
|
||||||
|
|
@ -1578,7 +1579,8 @@ def _get_post_title_announce_html(base_dir: str,
|
||||||
actor_type = get_actor_type(base_dir, attributed_to, person_cache)
|
actor_type = get_actor_type(base_dir, attributed_to, person_cache)
|
||||||
bot_prefix = ''
|
bot_prefix = ''
|
||||||
if actor_type:
|
if actor_type:
|
||||||
if actor_type != 'Person':
|
if actor_type != 'Person' or \
|
||||||
|
announce_nickname in chatbot_nicknames():
|
||||||
bot_prefix = '[' + translate['Bot'] + '] '
|
bot_prefix = '[' + translate['Bot'] + '] '
|
||||||
|
|
||||||
_log_post_timing(enable_timing_log, post_start_time, '13.3.1')
|
_log_post_timing(enable_timing_log, post_start_time, '13.3.1')
|
||||||
|
|
@ -1730,7 +1732,11 @@ def _get_reply_html(translate: {},
|
||||||
|
|
||||||
bot_prefix = ''
|
bot_prefix = ''
|
||||||
if actor_type:
|
if actor_type:
|
||||||
if actor_type != 'Person':
|
reply_nickname = ''
|
||||||
|
if '@' in reply_nickname:
|
||||||
|
reply_nickname = reply_handle.split('@')[0]
|
||||||
|
if actor_type != 'Person' or \
|
||||||
|
reply_nickname in chatbot_nicknames():
|
||||||
bot_prefix = '[' + translate['Bot'] + '] '
|
bot_prefix = '[' + translate['Bot'] + '] '
|
||||||
|
|
||||||
replying_to_str = _replying_to_with_scope(post_json_object, translate)
|
replying_to_str = _replying_to_with_scope(post_json_object, translate)
|
||||||
|
|
@ -2692,7 +2698,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
||||||
actor_type = get_actor_type(base_dir, post_actor, person_cache)
|
actor_type = get_actor_type(base_dir, post_actor, person_cache)
|
||||||
bot_prefix = ''
|
bot_prefix = ''
|
||||||
if actor_type:
|
if actor_type:
|
||||||
if actor_type != 'Person':
|
if actor_type != 'Person' or \
|
||||||
|
actor_nickname in chatbot_nicknames():
|
||||||
bot_prefix = '[' + translate['Bot'] + '] '
|
bot_prefix = '[' + translate['Bot'] + '] '
|
||||||
|
|
||||||
if display_name:
|
if display_name:
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ from textmode import text_mode_removals
|
||||||
from unicodetext import uninvert_text
|
from unicodetext import uninvert_text
|
||||||
from unicodetext import standardize_text
|
from unicodetext import standardize_text
|
||||||
from occupation import get_occupation_name
|
from occupation import get_occupation_name
|
||||||
|
from utils import chatbot_nicknames
|
||||||
from utils import get_actor_type
|
from utils import get_actor_type
|
||||||
from utils import get_mutuals_of_person
|
from utils import get_mutuals_of_person
|
||||||
from utils import get_person_icon
|
from utils import get_person_icon
|
||||||
|
|
@ -351,7 +352,8 @@ def html_profile_after_search(authorized: bool,
|
||||||
# is this a bot account?
|
# is this a bot account?
|
||||||
if profile_json.get('type'):
|
if profile_json.get('type'):
|
||||||
if isinstance(profile_json['type'], str):
|
if isinstance(profile_json['type'], str):
|
||||||
if profile_json['type'] != 'Person':
|
if profile_json['type'] != 'Person' or \
|
||||||
|
search_nickname in chatbot_nicknames():
|
||||||
display_name = '[' + translate['Bot'] + '] ' + display_name
|
display_name = '[' + translate['Bot'] + '] ' + display_name
|
||||||
|
|
||||||
pronouns = get_pronouns(profile_json)
|
pronouns = get_pronouns(profile_json)
|
||||||
|
|
@ -1186,7 +1188,8 @@ def html_profile(signing_priv_key_pem: str,
|
||||||
# is this a bot account?
|
# is this a bot account?
|
||||||
if profile_json.get('type'):
|
if profile_json.get('type'):
|
||||||
if isinstance(profile_json['type'], str):
|
if isinstance(profile_json['type'], str):
|
||||||
if profile_json['type'] != 'Person':
|
if profile_json['type'] != 'Person' or \
|
||||||
|
nickname in chatbot_nicknames():
|
||||||
display_name = '[' + translate['Bot'] + '] ' + display_name
|
display_name = '[' + translate['Bot'] + '] ' + display_name
|
||||||
|
|
||||||
domain_full = get_full_domain(domain, port)
|
domain_full = get_full_domain(domain, port)
|
||||||
|
|
@ -3924,7 +3927,8 @@ def _individual_follow_as_html(signing_priv_key_pem: str,
|
||||||
actor_nickname, domain,
|
actor_nickname, domain,
|
||||||
display_name, False, translate)
|
display_name, False, translate)
|
||||||
actor_type = get_actor_type(base_dir, follow_url, person_cache)
|
actor_type = get_actor_type(base_dir, follow_url, person_cache)
|
||||||
if actor_type != 'Person':
|
if actor_type != 'Person' or \
|
||||||
|
actor_nickname in chatbot_nicknames():
|
||||||
display_name = '[' + translate['Bot'] + '] ' + display_name
|
display_name = '[' + translate['Bot'] + '] ' + display_name
|
||||||
title_str = display_name
|
title_str = display_name
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue