Show icon when post is delivered via a cloudflare-like intermediary

main
Bob Mottram 2022-03-14 20:47:13 +00:00
parent b68fd5c561
commit fd1db142a5
37 changed files with 66 additions and 27 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -517,5 +517,6 @@
"Repeated by": "يتكرر بواسطة",
"Register": "يسجل",
"Web Bots Allowed": "مسموح روبوتات الويب",
"Known Search Bots": "روبوتات بحث الويب المعروفة"
"Known Search Bots": "روبوتات بحث الويب المعروفة",
"mitm": "يمكن قراءة الرسالة أو تعديلها من قبل طرف ثالث"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Repetit per",
"Register": "Registra't",
"Web Bots Allowed": "Bots web permesos",
"Known Search Bots": "Bots de cerca web coneguts"
"Known Search Bots": "Bots de cerca web coneguts",
"mitm": "El missatge podria haver estat llegit o modificat per un tercer"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Ailadrodd gan",
"Register": "Cofrestrwch",
"Web Bots Allowed": "Web Bots a Ganiateir",
"Known Search Bots": "Bots Chwilio Gwe Hysbys"
"Known Search Bots": "Bots Chwilio Gwe Hysbys",
"mitm": "Gallai'r neges fod wedi cael ei darllen neu ei haddasu gan drydydd parti"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Wiederholt von",
"Register": "Registrieren",
"Web Bots Allowed": "Webbots erlaubt",
"Known Search Bots": "Bekannte Bots für die Websuche"
"Known Search Bots": "Bekannte Bots für die Websuche",
"mitm": "Die Nachricht könnte von einem Dritten gelesen oder geändert worden sein"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Repeated by",
"Register": "Register",
"Web Bots Allowed": "Web Search Bots Allowed",
"Known Search Bots": "Known Web Search Bots"
"Known Search Bots": "Known Web Search Bots",
"mitm": "Message could have been read or modified by a third party"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Repetido por",
"Register": "Registrarse",
"Web Bots Allowed": "Bots web permitidos",
"Known Search Bots": "Bots de búsqueda web conocidos"
"Known Search Bots": "Bots de búsqueda web conocidos",
"mitm": "El mensaje podría haber sido leído o modificado por un tercero"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Répété par",
"Register": "S'inscrire",
"Web Bots Allowed": "Robots Web autorisés",
"Known Search Bots": "Robots de recherche Web connus"
"Known Search Bots": "Robots de recherche Web connus",
"mitm": "Le message a pu être lu ou modifié par un tiers"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Arís agus arís eile ag",
"Register": "Clár",
"Web Bots Allowed": "Róbónna Gréasáin Ceadaithe",
"Known Search Bots": "Róbónna Cuardach Gréasáin Aitheanta"
"Known Search Bots": "Róbónna Cuardach Gréasáin Aitheanta",
"mitm": "D'fhéadfadh tríú páirtí an teachtaireacht a léamh nó a mhodhnú"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "द्वारा दोहराया गया",
"Register": "रजिस्टर करें",
"Web Bots Allowed": "वेब बॉट्स की अनुमति है",
"Known Search Bots": "ज्ञात वेब खोज बॉट्स"
"Known Search Bots": "ज्ञात वेब खोज बॉट्स",
"mitm": "संदेश किसी तीसरे पक्ष द्वारा पढ़ा या संशोधित किया जा सकता था"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Ripetuto da",
"Register": "Registrati",
"Web Bots Allowed": "Web bot consentiti",
"Known Search Bots": "Bot di ricerca Web noti"
"Known Search Bots": "Bot di ricerca Web noti",
"mitm": "Il messaggio potrebbe essere stato letto o modificato da terzi"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "によって繰り返される",
"Register": "登録",
"Web Bots Allowed": "許可されたWebボット",
"Known Search Bots": "既知のWeb検索ボット"
"Known Search Bots": "既知のWeb検索ボット",
"mitm": "メッセージが第三者によって読み取られたり変更されたりした可能性があります"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "반복한 사람",
"Register": "등록",
"Web Bots Allowed": "웹 봇 허용",
"Known Search Bots": "알려진 웹 검색 봇"
"Known Search Bots": "알려진 웹 검색 봇",
"mitm": "제3자가 메시지를 읽거나 수정했을 수 있습니다."
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Ji hêla dubare kirin",
"Register": "Fêhrist",
"Web Bots Allowed": "Web Bots Destûrdar in",
"Known Search Bots": "Botên Lêgerîna Webê yên naskirî"
"Known Search Bots": "Botên Lêgerîna Webê yên naskirî",
"mitm": "Peyam dikaribû ji hêla aliyek sêyemîn ve were xwendin an guhertin"
}

View File

@ -513,5 +513,6 @@
"Repeated by": "Repeated by",
"Register": "Register",
"Web Bots Allowed": "Web Search Bots Allowed",
"Known Search Bots": "Known Web Search Bots"
"Known Search Bots": "Known Web Search Bots",
"mitm": "Message could have been read or modified by a third party"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Powtórzone przez",
"Register": "Zarejestrować",
"Web Bots Allowed": "Dozwolone boty internetowe",
"Known Search Bots": "Znane boty wyszukiwania w sieci"
"Known Search Bots": "Znane boty wyszukiwania w sieci",
"mitm": "Wiadomość mogła zostać przeczytana lub zmodyfikowana przez osobę trzecią"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Repetido por",
"Register": "Registro",
"Web Bots Allowed": "Webbots permitidos",
"Known Search Bots": "Bots de pesquisa na Web conhecidos"
"Known Search Bots": "Bots de pesquisa na Web conhecidos",
"mitm": "A mensagem pode ter sido lida ou modificada por terceiros"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Повторено",
"Register": "регистр",
"Web Bots Allowed": "Веб-боты разрешены",
"Known Search Bots": "Известные боты веб-поиска"
"Known Search Bots": "Известные боты веб-поиска",
"mitm": "Сообщение могло быть прочитано или изменено третьим лицом"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Imerudiwa na",
"Register": "Sajili",
"Web Bots Allowed": "Mtandao wa Boti Unaruhusiwa",
"Known Search Bots": "Vijibu vya Utafutaji wa Wavuti vinavyojulikana"
"Known Search Bots": "Vijibu vya Utafutaji wa Wavuti vinavyojulikana",
"mitm": "Ujumbe ungeweza kusomwa au kurekebishwa na mtu mwingine"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "Повторюється за",
"Register": "Реєстрація",
"Web Bots Allowed": "Веб-боти дозволені",
"Known Search Bots": "Відомі пошукові роботи в Інтернеті"
"Known Search Bots": "Відомі пошукові роботи в Інтернеті",
"mitm": "Повідомлення могло бути прочитане або змінене третьою стороною"
}

View File

@ -517,5 +517,6 @@
"Repeated by": "重复",
"Register": "登记",
"Web Bots Allowed": "允许网络机器人",
"Known Search Bots": "已知的网络搜索机器人"
"Known Search Bots": "已知的网络搜索机器人",
"mitm": "消息可能已被第三方阅读或修改"
}

View File

@ -1026,8 +1026,8 @@ def _get_post_title_announce_html(base_dir: str,
page_number: int,
message_id_str: str,
container_class_icons: str,
container_class: str) -> (str, str,
str, str):
container_class: str,
mitm: bool) -> (str, str, str, str):
"""Returns the announce title of a post containing names of participants
x announces y
"""
@ -1081,6 +1081,10 @@ def _get_post_title_announce_html(base_dir: str,
title_str += \
_announce_with_display_name_html(translate, post_json_object,
announce_display_name)
if mitm:
title_str += _mitm_warning_html(translate)
# show avatar of person replied to
announce_actor = attributed_to
announce_avatar_url = \
@ -1141,6 +1145,16 @@ def _reply_to_unknown_html(translate: {},
'" class="announceOrReply">@unknown</a>\n'
def _mitm_warning_html(translate: {}) -> str:
"""Returns the html title for a reply to an unknown handle
"""
mitm_warning_str = translate['mitm']
return ' <img loading="lazy" title="' + \
mitm_warning_str + '" alt="' + \
mitm_warning_str + '" src="/icons' + \
'/mitm.png" class="announceOrReply"/>\n'
def _reply_with_unknown_path_html(translate: {},
post_json_object: {},
post_domain: str) -> str:
@ -1196,7 +1210,8 @@ def _get_post_title_reply_html(base_dir: str,
page_number: int,
message_id_str: str,
container_class_icons: str,
container_class: str) -> (str, str, str, str):
container_class: str,
mitm: bool) -> (str, str, str, str):
"""Returns the reply title of a post containing names of participants
x replies to y
"""
@ -1264,6 +1279,9 @@ def _get_post_title_reply_html(base_dir: str,
title_str += _get_reply_html(translate, in_reply_to, reply_display_name)
if mitm:
title_str += _mitm_warning_html(translate)
_log_post_timing(enable_timing_log, post_start_time, '13.7')
# show avatar of person replied to
@ -1309,7 +1327,8 @@ def _get_post_title_html(base_dir: str,
page_number: int,
message_id_str: str,
container_class_icons: str,
container_class: str) -> (str, str, str, str):
container_class: str,
mitm: bool) -> (str, str, str, str):
"""Returns the title of a post containing names of participants
x replies to y, x announces y, etc
"""
@ -1337,7 +1356,7 @@ def _get_post_title_html(base_dir: str,
page_number,
message_id_str,
container_class_icons,
container_class)
container_class, mitm)
return _get_post_title_reply_html(base_dir,
http_prefix,
@ -1356,7 +1375,7 @@ def _get_post_title_html(base_dir: str,
page_number,
message_id_str,
container_class_icons,
container_class)
container_class, mitm)
def _get_footer_with_icons(show_icons: bool,
@ -1846,7 +1865,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
page_number,
message_id_str,
container_class_icons,
container_class)
container_class, mitm)
title_str += title_str2
_log_post_timing(enable_timing_log, post_start_time, '14')