Show warning if account blocks incoming posts

main
Bob Mottram 2023-08-29 18:39:07 +01:00
parent 8413acb9f6
commit 1bea706c5a
28 changed files with 73 additions and 29 deletions

View File

@ -633,5 +633,6 @@
"Clear Cache": "مسح ذاكرة التخزين المؤقت",
"Block military instances": "منع الحالات العسكرية",
"Display on your public profile": "عرض على ملفك الشخصي العام",
"FollowWarning": "تحذير: قد يكون هذا المثيل يمنعك"
"FollowWarning": "تحذير: قد يكون هذا المثيل يمنعك",
"FollowAccountWarning": "تحذير: قد يكون هذا الحساب قد قام بحظرك"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "ক্যাশে সাফ করুন",
"Block military instances": "সামরিক দৃষ্টান্ত ব্লক করুন",
"Display on your public profile": "আপনার পাবলিক প্রোফাইলে প্রদর্শন করুন",
"FollowWarning": "সতর্কতা: এই উদাহরণটি আপনাকে অবরুদ্ধ করতে পারে"
"FollowWarning": "সতর্কতা: এই উদাহরণটি আপনাকে অবরুদ্ধ করতে পারে",
"FollowAccountWarning": "সতর্কতা: এই অ্যাকাউন্টটি আপনাকে ব্লক করতে পারে"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Netejar memòria cau",
"Block military instances": "Bloquejar instàncies militars",
"Display on your public profile": "Mostra al teu perfil públic",
"FollowWarning": "ADVERTIMENT: aquesta instància pot estar bloquejant-vos"
"FollowWarning": "ADVERTIMENT: aquesta instància pot estar bloquejant-vos",
"FollowAccountWarning": "ADVERTIMENT: és possible que aquest compte us estigui bloquejant"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Clirio Cache",
"Block military instances": "Rhwystro achosion milwrol",
"Display on your public profile": "Arddangos ar eich proffil cyhoeddus",
"FollowWarning": "RHYBUDD: efallai bod yr achos hwn yn eich rhwystro"
"FollowWarning": "RHYBUDD: efallai bod yr achos hwn yn eich rhwystro",
"FollowAccountWarning": "RHYBUDD: efallai bod y cyfrif hwn yn eich rhwystro"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Cache leeren",
"Block military instances": "Militärische Instanzen blockieren",
"Display on your public profile": "Anzeige in Ihrem öffentlichen Profil",
"FollowWarning": "ACHTUNG: Diese Instanz blockiert Sie möglicherweise"
"FollowWarning": "ACHTUNG: Diese Instanz blockiert Sie möglicherweise",
"FollowAccountWarning": "ACHTUNG: Dieses Konto blockiert Sie möglicherweise"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Εκκαθάριση προσωρινής μνήμης",
"Block military instances": "Αποκλεισμός στρατιωτικών περιπτώσεων",
"Display on your public profile": "Εμφάνιση στο δημόσιο προφίλ σας",
"FollowWarning": "ΠΡΟΕΙΔΟΠΟΙΗΣΗ: αυτή η περίπτωση μπορεί να σας μπλοκάρει"
"FollowWarning": "ΠΡΟΕΙΔΟΠΟΙΗΣΗ: αυτή η περίπτωση μπορεί να σας μπλοκάρει",
"FollowAccountWarning": "ΠΡΟΕΙΔΟΠΟΙΗΣΗ: αυτός ο λογαριασμός μπορεί να σας αποκλείει"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Clear Cache",
"Block military instances": "Block military instances",
"Display on your public profile": "Display on your public profile",
"FollowWarning": "WARNING: this instance may be blocking you"
"FollowWarning": "WARNING: this instance may be blocking you",
"FollowAccountWarning": "WARNING: this account may be blocking you"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Limpiar cache",
"Block military instances": "Bloquear instancias militares",
"Display on your public profile": "Mostrar en su perfil público",
"FollowWarning": "ADVERTENCIA: esta instancia puede estar bloqueándote"
"FollowWarning": "ADVERTENCIA: esta instancia puede estar bloqueándote",
"FollowAccountWarning": "ADVERTENCIA: esta cuenta puede estar bloqueándote"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "پاک کردن حافظه پنهان",
"Block military instances": "موارد نظامی را مسدود کنید",
"Display on your public profile": "نمایش در نمایه عمومی شما",
"FollowWarning": "هشدار: این مورد ممکن است شما را مسدود کند"
"FollowWarning": "هشدار: این مورد ممکن است شما را مسدود کند",
"FollowAccountWarning": "هشدار: این حساب ممکن است شما را مسدود کند"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Vider le cache",
"Block military instances": "Bloquer les instances militaires",
"Display on your public profile": "Afficher sur votre profil public",
"FollowWarning": "ATTENTION : cette instance peut vous bloquer"
"FollowWarning": "ATTENTION : cette instance peut vous bloquer",
"FollowAccountWarning": "ATTENTION : ce compte peut vous bloquer"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Glan Taisce",
"Block military instances": "Bloc cásanna míleata",
"Display on your public profile": "Taispeáin ar do phróifíl phoiblí",
"FollowWarning": "RABHADH: seans go bhfuil an cás seo ag cur bac ort"
"FollowWarning": "RABHADH: seans go bhfuil an cás seo ag cur bac ort",
"FollowAccountWarning": "RABHADH: seans go bhfuil an cuntas seo ag cur bac ort"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "נקה מטמון",
"Block military instances": "חסום מקרים צבאיים",
"Display on your public profile": "הצג בפרופיל הציבורי שלך",
"FollowWarning": "אזהרה: ייתכן שהמקרה הזה חוסם אותך"
"FollowWarning": "אזהרה: ייתכן שהמקרה הזה חוסם אותך",
"FollowAccountWarning": "אזהרה: ייתכן שחשבון זה חוסם אותך"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "कैश को साफ़ करें",
"Block military instances": "सैन्य उदाहरणों को ब्लॉक करें",
"Display on your public profile": "अपनी सार्वजनिक प्रोफ़ाइल पर प्रदर्शित करें",
"FollowWarning": "चेतावनी: यह उदाहरण आपको अवरुद्ध कर सकता है"
"FollowWarning": "चेतावनी: यह उदाहरण आपको अवरुद्ध कर सकता है",
"FollowAccountWarning": "चेतावनी: यह खाता आपको ब्लॉक कर सकता है"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Cancella cache",
"Block military instances": "Blocca istanze militari",
"Display on your public profile": "Visualizza sul tuo profilo pubblico",
"FollowWarning": "ATTENZIONE: questa istanza potrebbe bloccarti"
"FollowWarning": "ATTENZIONE: questa istanza potrebbe bloccarti",
"FollowAccountWarning": "ATTENZIONE: questo account potrebbe bloccarti"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "キャッシュの消去",
"Block military instances": "軍事インスタンスをブロックする",
"Display on your public profile": "公開プロフィールに表示する",
"FollowWarning": "警告: このインスタンスはあなたをブロックしている可能性があります"
"FollowWarning": "警告: このインスタンスはあなたをブロックしている可能性があります",
"FollowAccountWarning": "警告: このアカウントはあなたをブロックしている可能性があります"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "캐시 지우기",
"Block military instances": "군사 인스턴스 차단",
"Display on your public profile": "공개 프로필에 표시",
"FollowWarning": "경고: 이 인스턴스가 귀하를 차단하고 있을 수 있습니다."
"FollowWarning": "경고: 이 인스턴스가 귀하를 차단하고 있을 수 있습니다.",
"FollowAccountWarning": "경고: 이 계정이 귀하를 차단하고 있을 수 있습니다."
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Cache paqij bike",
"Block military instances": "Mînakên leşkerî asteng bikin",
"Display on your public profile": "Li ser profîla xweya giştî nîşan bidin",
"FollowWarning": "HIŞYARÎ: dibe ku ev mînak we asteng bike"
"FollowWarning": "HIŞYARÎ: dibe ku ev mînak we asteng bike",
"FollowAccountWarning": "HIŞYARÎ: Dibe ku ev hesab we asteng bike"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Cache wissen",
"Block military instances": "Blokkeer militaire instanties",
"Display on your public profile": "Weergave op uw openbare profiel",
"FollowWarning": "WAARSCHUWING: deze instantie blokkeert u mogelijk"
"FollowWarning": "WAARSCHUWING: deze instantie blokkeert u mogelijk",
"FollowAccountWarning": "WAARSCHUWING: dit account blokkeert u mogelijk"
}

View File

@ -629,5 +629,6 @@
"Clear Cache": "Clear Cache",
"Block military instances": "Block military instances",
"Display on your public profile": "Display on your public profile",
"FollowWarning": "WARNING: this instance may be blocking you"
"FollowWarning": "WARNING: this instance may be blocking you",
"FollowAccountWarning": "WARNING: this account may be blocking you"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Wyczyść pamięć podręczną",
"Block military instances": "Blokuj instancje wojskowe",
"Display on your public profile": "Wyświetlaj na swoim profilu publicznym",
"FollowWarning": "OSTRZEŻENIE: ta instancja może Cię blokować"
"FollowWarning": "OSTRZEŻENIE: ta instancja może Cię blokować",
"FollowAccountWarning": "OSTRZEŻENIE: to konto może Cię blokować"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Limpar cache",
"Block military instances": "Bloquear instâncias militares",
"Display on your public profile": "Exibir em seu perfil público",
"FollowWarning": "AVISO: esta instância pode estar bloqueando você"
"FollowWarning": "AVISO: esta instância pode estar bloqueando você",
"FollowAccountWarning": "AVISO: esta conta pode estar bloqueando você"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Очистить кэш",
"Block military instances": "Блокировать военные инстансы",
"Display on your public profile": "Отобразить в своем общедоступном профиле",
"FollowWarning": "ВНИМАНИЕ: этот экземпляр может блокировать вас."
"FollowWarning": "ВНИМАНИЕ: этот экземпляр может блокировать вас.",
"FollowAccountWarning": "ВНИМАНИЕ: этот аккаунт может вас заблокировать"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Futa Cache",
"Block military instances": "Zuia matukio ya kijeshi",
"Display on your public profile": "Onyesha kwenye wasifu wako wa umma",
"FollowWarning": "ONYO: mfano huu unaweza kuwa unakuzuia"
"FollowWarning": "ONYO: mfano huu unaweza kuwa unakuzuia",
"FollowAccountWarning": "ONYO: akaunti hii inaweza kuwa inakuzuia"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Önbelleği Temizle",
"Block military instances": "Askeri örnekleri engelle",
"Display on your public profile": "Herkese açık profilinizde görüntüleyin",
"FollowWarning": "UYARI: bu örnek sizi engelliyor olabilir"
"FollowWarning": "UYARI: bu örnek sizi engelliyor olabilir",
"FollowAccountWarning": "DİKKAT: Bu hesap sizi engelliyor olabilir"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "Очистити кеш",
"Block military instances": "Блокувати військові інстанції",
"Display on your public profile": "Відображати у своєму публічному профілі",
"FollowWarning": "УВАГА: цей екземпляр може блокувати вас"
"FollowWarning": "УВАГА: цей екземпляр може блокувати вас",
"FollowAccountWarning": "УВАГА: цей обліковий запис може блокувати вас"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "קלאָר קאַש",
"Block military instances": "פאַרשפּאַרן מיליטעריש ינסטאַנסיז",
"Display on your public profile": "ווייַז אויף דיין עפנטלעך פּראָפיל",
"FollowWarning": "ווארענונג: דעם בייַשפּיל קען פאַרשפּאַרן איר"
"FollowWarning": "ווארענונג: דעם בייַשפּיל קען פאַרשפּאַרן איר",
"FollowAccountWarning": "ווארענונג: דער חשבון קען בלאַקינג איר"
}

View File

@ -633,5 +633,6 @@
"Clear Cache": "קלאָר קאַש",
"Block military instances": "阻止军事实例",
"Display on your public profile": "显示在您的公开个人资料上",
"FollowWarning": "警告:此实例可能会阻止您"
"FollowWarning": "警告:此实例可能会阻止您",
"FollowAccountWarning": "警告:此帐户可能会阻止您"
}

View File

@ -10,6 +10,7 @@ __module_group__ = "Web Interface"
import os
from pprint import pprint
from webfinger import webfinger_handle
from utils import text_in_file
from utils import dangerous_markup
from utils import ap_proxy_type
from utils import remove_id_ending
@ -360,6 +361,18 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
website_url = get_website(profile_json, translate)
repo_url = get_repo_url(profile_json)
# is sending posts to this account blocked?
send_block_filename = \
acct_dir(base_dir, nickname, domain) + '/send_blocks.txt'
send_blocks_str = ''
if os.path.isfile(send_block_filename):
if text_in_file(person_url,
send_block_filename, False):
send_blocks_str = translate['FollowAccountWarning']
elif text_in_file('://' + search_domain_full,
send_block_filename, False):
send_blocks_str = translate['FollowWarning']
profile_str = \
_get_profile_header_after_search(nickname, default_timeline,
search_nickname,
@ -373,7 +386,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int,
also_known_as, access_keys,
joined_date, actor_proxied,
attached_shared_items,
website_url, repo_url)
website_url, repo_url,
send_blocks_str)
domain_full = get_full_domain(domain, port)
@ -690,7 +704,8 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str,
actor_proxied: str,
attached_shared_items: str,
website_url: str,
repo_url: str) -> str:
repo_url: str,
send_blocks_str: str) -> str:
"""The header of a searched for handle, containing background
image and avatar
"""
@ -742,6 +757,8 @@ def _get_profile_header_after_search(nickname: str, default_timeline: str,
joined_date.split('T')[0] + '</p>\n'
if follows_you:
html_str += ' <p><b>' + translate['Follows you'] + '</b></p>\n'
if send_blocks_str:
html_str += ' <p><b>' + send_blocks_str + '</b></p>\n'
if moved_to:
new_nickname = get_nickname_from_actor(moved_to)
new_domain, new_port = get_domain_from_actor(moved_to)