mirror of https://gitlab.com/bashrc2/epicyon
Indicate whether accounts are bots
parent
89872cd005
commit
8ef9ddaca2
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "ورش العمل / مشاركة المهارات",
|
||||
"Status": "حالة",
|
||||
"Warning: Possible dangerous link": "تحذير: رابط خطير محتمل",
|
||||
"Mutual": "مشترك"
|
||||
"Mutual": "مشترك",
|
||||
"Bot": "الروبوت"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "কর্মশালা / দক্ষতা ভাগ করে নেওয়া",
|
||||
"Status": "অবস্থা",
|
||||
"Warning: Possible dangerous link": "সতর্কতা: সম্ভাব্য বিপজ্জনক লিঙ্ক",
|
||||
"Mutual": "পারস্পরিক"
|
||||
"Mutual": "পারস্পরিক",
|
||||
"Bot": "রোবট"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Tallers / compartició d’habilitats",
|
||||
"Status": "Estat",
|
||||
"Warning: Possible dangerous link": "Avís: Possible enllaç perillós",
|
||||
"Mutual": "Mútua"
|
||||
"Mutual": "Mútua",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Gweithdai / Rhannu Sgiliau",
|
||||
"Status": "Statws",
|
||||
"Warning: Possible dangerous link": "Rhybudd: Cyswllt peryglus posibl",
|
||||
"Mutual": "Cydfuddiannol"
|
||||
"Mutual": "Cydfuddiannol",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Workshops / Fertigkeitsaustausch",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Warnung: Möglicher gefährlicher Link",
|
||||
"Mutual": "Gegenseitig"
|
||||
"Mutual": "Gegenseitig",
|
||||
"Bot": "Roboter"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Εργαστήρια / κοινή χρήση δεξιοτήτων",
|
||||
"Status": "Κατάσταση",
|
||||
"Warning: Possible dangerous link": "Προειδοποίηση: Πιθανός επικίνδυνος σύνδεσμος",
|
||||
"Mutual": "Αμοιβαίος"
|
||||
"Mutual": "Αμοιβαίος",
|
||||
"Bot": "Ρομπότ"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Workshops / Skill sharing",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Warning: Possible dangerous link",
|
||||
"Mutual": "Mutual"
|
||||
"Mutual": "Mutual",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Talleres / Experiencia de habilidades",
|
||||
"Status": "Estado",
|
||||
"Warning: Possible dangerous link": "Advertencia: Posible enlace peligroso",
|
||||
"Mutual": "Mutual"
|
||||
"Mutual": "Mutual",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "کارگاه ها / اشتراک مهارت",
|
||||
"Status": "وضعیت",
|
||||
"Warning: Possible dangerous link": "هشدار: احتمال لینک خطرناک",
|
||||
"Mutual": "متقابل"
|
||||
"Mutual": "متقابل",
|
||||
"Bot": "ربات"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Työpajat / taitojen jakaminen",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Varoitus: Mahdollisesti vaarallinen linkki",
|
||||
"Mutual": "Keskinäinen"
|
||||
"Mutual": "Keskinäinen",
|
||||
"Bot": "Robotti"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Ateliers / partage des compétences",
|
||||
"Status": "Statut",
|
||||
"Warning: Possible dangerous link": "Avertissement : lien potentiellement dangereux",
|
||||
"Mutual": "Mutuelle"
|
||||
"Mutual": "Mutuelle",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Ceardlanna / comhroinnt scileanna",
|
||||
"Status": "Stádas",
|
||||
"Warning: Possible dangerous link": "Rabhadh: Nasc contúirteach féideartha",
|
||||
"Mutual": "Frithpháirteach"
|
||||
"Mutual": "Frithpháirteach",
|
||||
"Bot": "Róbat"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "סדנאות / שיתוף מיומנות",
|
||||
"Status": "סטָטוּס",
|
||||
"Warning: Possible dangerous link": "אזהרה: קישור מסוכן אפשרי",
|
||||
"Mutual": "הֲדָדִי"
|
||||
"Mutual": "הֲדָדִי",
|
||||
"Bot": "רוֹבּוֹט"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "कार्यशालाएं / कौशल साझाकरण",
|
||||
"Status": "स्थिति",
|
||||
"Warning: Possible dangerous link": "चेतावनी: संभावित खतरनाक लिंक",
|
||||
"Mutual": "आपसी"
|
||||
"Mutual": "आपसी",
|
||||
"Bot": "रोबोट"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Seminari / condivisione delle competenze",
|
||||
"Status": "Stato",
|
||||
"Warning: Possible dangerous link": "Attenzione: possibile collegamento pericoloso",
|
||||
"Mutual": "Reciproca"
|
||||
"Mutual": "Reciproca",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "ワークショップ /スキル共有",
|
||||
"Status": "状態",
|
||||
"Warning: Possible dangerous link": "警告: 危険なリンクの可能性があります",
|
||||
"Mutual": "共通の"
|
||||
"Mutual": "共通の",
|
||||
"Bot": "ロボット"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "워크샵 / 기술 공유",
|
||||
"Status": "상태",
|
||||
"Warning: Possible dangerous link": "경고: 위험한 링크가 있을 수 있습니다",
|
||||
"Mutual": "상호간의"
|
||||
"Mutual": "상호간의",
|
||||
"Bot": "기계 인간"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Karker / Parvekirina Skill",
|
||||
"Status": "Cî",
|
||||
"Warning: Possible dangerous link": "Hişyarî: Girêdaneke gengaz a xeternak",
|
||||
"Mutual": "Beramberî"
|
||||
"Mutual": "Beramberî",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Workshops / vaardigheden delen",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Waarschuwing: Mogelijk gevaarlijke link",
|
||||
"Mutual": "Wederzijds"
|
||||
"Mutual": "Wederzijds",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -759,5 +759,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Workshops / Skill sharing",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Warning: Possible dangerous link",
|
||||
"Mutual": "Mutual"
|
||||
"Mutual": "Mutual",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Warsztaty / udostępnianie umiejętności",
|
||||
"Status": "Status",
|
||||
"Warning: Possible dangerous link": "Ostrzeżenie: Możliwe niebezpieczne łącze",
|
||||
"Mutual": "Wzajemne"
|
||||
"Mutual": "Wzajemne",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Workshops / compartilhamento de habilidades",
|
||||
"Status": "Estatuto",
|
||||
"Warning: Possible dangerous link": "Aviso: possível ligação perigosa",
|
||||
"Mutual": "Mútua"
|
||||
"Mutual": "Mútua",
|
||||
"Bot": "Robô"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Семинары / обмен навыками",
|
||||
"Status": "Статус",
|
||||
"Warning: Possible dangerous link": "Внимание: возможная опасная ссылка",
|
||||
"Mutual": "Взаимный"
|
||||
"Mutual": "Взаимный",
|
||||
"Bot": "Робот"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Warsha / Kushiriki kwa Ustadi",
|
||||
"Status": "Hali",
|
||||
"Warning: Possible dangerous link": "Onyo: Kiungo hatari kinachowezekana",
|
||||
"Mutual": "Kuheshimiana"
|
||||
"Mutual": "Kuheshimiana",
|
||||
"Bot": "Roboti"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Çalıştaylar / Beceri Paylaşımı",
|
||||
"Status": "Durum",
|
||||
"Warning: Possible dangerous link": "Uyarı: Olası tehlikeli bağlantı",
|
||||
"Mutual": "Karşılıklı"
|
||||
"Mutual": "Karşılıklı",
|
||||
"Bot": "Bot"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "Семінари / обмін навичками",
|
||||
"Status": "Статус",
|
||||
"Warning: Possible dangerous link": "Попередження: Можливе небезпечне посилання",
|
||||
"Mutual": "Взаємне"
|
||||
"Mutual": "Взаємне",
|
||||
"Bot": "Робот"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "וואָרקשאָפּ / סקילז ייַנטיילונג",
|
||||
"Status": "סטאַטוס",
|
||||
"Warning: Possible dangerous link": "ווארענונג: מעגלעכער געפערלעכער פארבינדונג",
|
||||
"Mutual": "קעגנצייַטיק"
|
||||
"Mutual": "קעגנצייַטיק",
|
||||
"Bot": "ראָבאָט"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -763,5 +763,6 @@
|
|||
"WORKSHOPS_SKILL_SHARING": "研讨会 /技能共享",
|
||||
"Status": "地位",
|
||||
"Warning: Possible dangerous link": "警告:可能存在危险链接",
|
||||
"Mutual": "相互的"
|
||||
"Mutual": "相互的",
|
||||
"Bot": "机器人"
|
||||
}
|
||||
|
|
|
|||
21
utils.py
21
utils.py
|
|
@ -1306,6 +1306,27 @@ def get_display_name(base_dir: str, actor: str, person_cache: {}) -> str:
|
|||
return standardize_text(name_found)
|
||||
|
||||
|
||||
def get_actor_type(base_dir: str, actor: str, person_cache: {}) -> str:
|
||||
"""Returns the type of actor
|
||||
"""
|
||||
actor = get_actor_from_post_id(actor)
|
||||
if not person_cache.get(actor):
|
||||
return None
|
||||
if person_cache[actor].get('actor'):
|
||||
if person_cache[actor]['actor'].get('type'):
|
||||
return person_cache[actor]['actor']['type']
|
||||
else:
|
||||
# Try to obtain from the cached actors
|
||||
cached_actor_filename = \
|
||||
base_dir + '/cache/actors/' + (actor.replace('/', '#')) + '.json'
|
||||
if os.path.isfile(cached_actor_filename):
|
||||
actor_json = load_json(cached_actor_filename)
|
||||
if actor_json:
|
||||
if actor_json.get('type'):
|
||||
return actor_json['type']
|
||||
return None
|
||||
|
||||
|
||||
def display_name_is_emoji(display_name: str) -> bool:
|
||||
"""Returns true if the given display name is an emoji
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ from utils import get_cached_post_directory
|
|||
from utils import get_cached_post_filename
|
||||
from utils import get_protocol_prefixes
|
||||
from utils import get_display_name
|
||||
from utils import get_actor_type
|
||||
from utils import display_name_is_emoji
|
||||
from utils import remove_id_ending
|
||||
from utils import get_nickname_from_actor
|
||||
|
|
@ -1574,8 +1575,14 @@ def _get_post_title_announce_html(base_dir: str,
|
|||
if announce_handle in mutuals_list:
|
||||
mutual_prefix = '⇆ '
|
||||
|
||||
actor_type = get_actor_type(base_dir, attributed_to, person_cache)
|
||||
bot_prefix = ''
|
||||
if actor_type != 'Person':
|
||||
bot_prefix = '[' + translate['Bot'] + '] '
|
||||
|
||||
_log_post_timing(enable_timing_log, post_start_time, '13.3.1')
|
||||
announce_display_name2 = mutual_prefix + announce_display_name
|
||||
announce_display_name2 = \
|
||||
mutual_prefix + bot_prefix + announce_display_name
|
||||
title_str += \
|
||||
_announce_with_display_name_html(translate, post_json_object,
|
||||
announce_display_name2,
|
||||
|
|
@ -1707,6 +1714,7 @@ def _reply_with_unknown_path_html(translate: {},
|
|||
|
||||
def _get_reply_html(translate: {},
|
||||
in_reply_to: str, reply_display_name: str,
|
||||
actor_type: str,
|
||||
nickname: str,
|
||||
post_json_object: {},
|
||||
reply_handle: str,
|
||||
|
|
@ -1719,6 +1727,10 @@ def _get_reply_html(translate: {},
|
|||
if reply_handle in mutuals_list:
|
||||
mutual_prefix = '⇆ '
|
||||
|
||||
bot_prefix = ''
|
||||
if actor_type != 'Person':
|
||||
bot_prefix = '[' + translate['Bot'] + '] '
|
||||
|
||||
replying_to_str = _replying_to_with_scope(post_json_object, translate)
|
||||
post_bookmark = '#' + bookmark_from_id(in_reply_to)
|
||||
post_link = '/users/' + nickname + '?convthread=' + \
|
||||
|
|
@ -1733,7 +1745,7 @@ def _get_reply_html(translate: {},
|
|||
' <a href="' + post_link + \
|
||||
'" class="announceOrReply" tabindex="10" title="' + \
|
||||
reply_handle + '">' + '<span itemprop="audience">' + \
|
||||
mutual_prefix + reply_display_name + '</span></a>\n'
|
||||
mutual_prefix + bot_prefix + reply_display_name + '</span></a>\n'
|
||||
|
||||
title_str += _get_instance_software_html(title_str, software_name)
|
||||
return title_str
|
||||
|
|
@ -1870,6 +1882,8 @@ def _get_post_title_reply_html(base_dir: str,
|
|||
reply_display_name = None
|
||||
if not reply_display_name:
|
||||
reply_display_name = reply_handle
|
||||
actor_type = \
|
||||
get_actor_type(base_dir, reply_actor, person_cache)
|
||||
|
||||
# add emoji to the display name
|
||||
if ':' in reply_display_name:
|
||||
|
|
@ -1887,8 +1901,8 @@ def _get_post_title_reply_html(base_dir: str,
|
|||
else:
|
||||
title_str += \
|
||||
_get_reply_html(translate, in_reply_to, reply_display_name,
|
||||
nickname, post_json_object, reply_handle,
|
||||
software_name, mutuals_list)
|
||||
actor_type, nickname, post_json_object,
|
||||
reply_handle, software_name, mutuals_list)
|
||||
|
||||
if mitm or reply_domain in mitm_servers:
|
||||
title_str += mitm_warning_html(translate)
|
||||
|
|
@ -2673,6 +2687,11 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
if actor_handle in mutuals_list:
|
||||
mutual_prefix = '⇆ '
|
||||
|
||||
actor_type = get_actor_type(base_dir, post_actor, person_cache)
|
||||
bot_prefix = ''
|
||||
if actor_type != 'Person':
|
||||
bot_prefix = '[' + translate['Bot'] + '] '
|
||||
|
||||
if display_name:
|
||||
display_name = _enforce_max_display_name_length(display_name)
|
||||
# add emojis
|
||||
|
|
@ -2686,8 +2705,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
nickname + '?options=' + post_actor + \
|
||||
';' + str(page_number) + ';' + avatar_url + message_id_str + \
|
||||
'" tabindex="10" title="' + actor_handle + '">' + \
|
||||
'<span itemprop="author">' + mutual_prefix + display_name + \
|
||||
mitm_str + '</span></a>\n'
|
||||
'<span itemprop="author">' + mutual_prefix + bot_prefix + \
|
||||
display_name + mitm_str + '</span></a>\n'
|
||||
else:
|
||||
if not message_id:
|
||||
# pprint(post_json_object)
|
||||
|
|
@ -2703,8 +2722,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
nickname + '?options=' + post_actor + \
|
||||
';' + str(page_number) + ';' + avatar_url + message_id_str + \
|
||||
'" tabindex="10">' + \
|
||||
'@<span itemprop="author">' + mutual_prefix + actor_handle + \
|
||||
mitm_str + '</span></a>\n'
|
||||
'@<span itemprop="author">' + mutual_prefix + bot_prefix + \
|
||||
actor_handle + mitm_str + '</span></a>\n'
|
||||
|
||||
# benchmark 9
|
||||
_log_post_timing(enable_timing_log, post_start_time, '9')
|
||||
|
|
|
|||
Loading…
Reference in New Issue