diff --git a/daemon.py b/daemon.py index 228243c2b..42c5be52e 100644 --- a/daemon.py +++ b/daemon.py @@ -12455,7 +12455,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.content_license_url, timezone, bold_reading, self.server.buy_sites, None, - self.server.max_shares_on_profile) + self.server.max_shares_on_profile, + self.server.sites_unavailable) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -12586,7 +12587,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile) + max_shares_on_profile, + self.server.sites_unavailable) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -15236,7 +15238,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - self.server.max_shares_on_profile) + self.server.max_shares_on_profile, + self.server.sites_unavailable) msg = msg.encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, @@ -15345,6 +15348,8 @@ class PubServer(BaseHTTPRequestHandler): bold_reading = True max_shares_on_profile = \ self.server.max_shares_on_profile + sites_unavailable = \ + self.server.sites_unavailable msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -15383,7 +15388,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile).encode('utf-8') + max_shares_on_profile, + sites_unavailable).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -15486,6 +15492,8 @@ class PubServer(BaseHTTPRequestHandler): bold_reading = True max_shares_on_profile = \ self.server.max_shares_on_profile + sites_unavailable = \ + self.server.sites_unavailable msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -15524,7 +15532,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile).encode('utf-8') + max_shares_on_profile, + sites_unavailable).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -15633,6 +15642,8 @@ class PubServer(BaseHTTPRequestHandler): bold_reading = True max_shares_on_profile = \ self.server.max_shares_on_profile + sites_unavailable = \ + self.server.sites_unavailable msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -15671,7 +15682,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile).encode('utf-8') + max_shares_on_profile, + sites_unavailable).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -15778,6 +15790,8 @@ class PubServer(BaseHTTPRequestHandler): bold_reading = True max_shares_on_profile = \ self.server.max_shares_on_profile + sites_unavailable = \ + self.server.sites_unavailable msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -15817,7 +15831,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile).encode('utf-8') + max_shares_on_profile, + sites_unavailable).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) @@ -15954,6 +15969,8 @@ class PubServer(BaseHTTPRequestHandler): bold_reading = True max_shares_on_profile = \ self.server.max_shares_on_profile + sites_unavailable = \ + self.server.sites_unavailable msg = \ html_profile(self.server.signing_priv_key_pem, self.server.rss_icon_at_top, @@ -15988,7 +16005,8 @@ class PubServer(BaseHTTPRequestHandler): timezone, bold_reading, self.server.buy_sites, None, - max_shares_on_profile).encode('utf-8') + max_shares_on_profile, + sites_unavailable).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, calling_domain, False) diff --git a/translations/ar.json b/translations/ar.json index 499f64d25..56bcc2645 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "تحذير: قد يكون هذا الحساب قد قام بحظرك", "Nicknames of memorial accounts (one per line)": "ألقاب الحسابات التذكارية (واحد في كل سطر)", "Memorials": "النصب التذكارية", - "places": "أماكن" + "places": "أماكن", + "offline": "غير متصل على الانترنت" } diff --git a/translations/bn.json b/translations/bn.json index 77db7935e..9d7e28199 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "সতর্কতা: এই অ্যাকাউন্টটি আপনাকে ব্লক করতে পারে", "Nicknames of memorial accounts (one per line)": "স্মারক অ্যাকাউন্টের ডাকনাম (প্রতি লাইনে একটি)", "Memorials": "স্মারক", - "places": "জায়গা" + "places": "জায়গা", + "offline": "অফলাইন" } diff --git a/translations/ca.json b/translations/ca.json index abd22328f..17c79d9d4 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ADVERTIMENT: és possible que aquest compte us estigui bloquejant", "Nicknames of memorial accounts (one per line)": "Sobrenoms dels comptes commemoratius (un per línia)", "Memorials": "Memorials", - "places": "llocs" + "places": "llocs", + "offline": "fora de línia" } diff --git a/translations/cy.json b/translations/cy.json index f5c6dc5f2..f58dbb6a8 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "RHYBUDD: efallai bod y cyfrif hwn yn eich rhwystro", "Nicknames of memorial accounts (one per line)": "Llysenwau cyfrifon coffa (un fesul llinell)", "Memorials": "Cofebau", - "places": "lleoedd" + "places": "lleoedd", + "offline": "all-lein" } diff --git a/translations/de.json b/translations/de.json index ea50a76cb..6d2634229 100644 --- a/translations/de.json +++ b/translations/de.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ACHTUNG: Dieses Konto blockiert Sie möglicherweise", "Nicknames of memorial accounts (one per line)": "Spitznamen der Gedenkkonten (einer pro Zeile)", "Memorials": "Denkmäler", - "places": "setzt" + "places": "setzt", + "offline": "offline" } diff --git a/translations/el.json b/translations/el.json index dc6c52d78..de042a351 100644 --- a/translations/el.json +++ b/translations/el.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ΠΡΟΕΙΔΟΠΟΙΗΣΗ: αυτός ο λογαριασμός μπορεί να σας αποκλείει", "Nicknames of memorial accounts (one per line)": "Ψευδώνυμα λογαριασμών μνήμης (ένα ανά γραμμή)", "Memorials": "Μνημείων", - "places": "μέρη" + "places": "μέρη", + "offline": "εκτός σύνδεσης" } diff --git a/translations/en.json b/translations/en.json index 7b92f1061..e94420c4c 100644 --- a/translations/en.json +++ b/translations/en.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "WARNING: this account may be blocking you", "Nicknames of memorial accounts (one per line)": "Nicknames of memorial accounts (one per line)", "Memorials": "Memorials", - "places": "places" + "places": "places", + "offline": "offline" } diff --git a/translations/es.json b/translations/es.json index c2e3d160f..1b76c0676 100644 --- a/translations/es.json +++ b/translations/es.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ADVERTENCIA: esta cuenta puede estar bloqueándote", "Nicknames of memorial accounts (one per line)": "Apodos de cuentas conmemorativas (uno por línea)", "Memorials": "Memoriales", - "places": "lugares" + "places": "lugares", + "offline": "desconectada" } diff --git a/translations/fa.json b/translations/fa.json index 61d56a46a..cdbed849c 100644 --- a/translations/fa.json +++ b/translations/fa.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "هشدار: این حساب ممکن است شما را مسدود کند", "Nicknames of memorial accounts (one per line)": "نام مستعار حساب های یادبود (یکی در هر خط)", "Memorials": "یادبودها", - "places": "مکان ها" + "places": "مکان ها", + "offline": "آفلاین" } diff --git a/translations/fr.json b/translations/fr.json index 32b47ebf6..960de7668 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ATTENTION : ce compte peut vous bloquer", "Nicknames of memorial accounts (one per line)": "Surnoms des comptes commémoratifs (un par ligne)", "Memorials": "Mémoriaux", - "places": "lieux" + "places": "lieux", + "offline": "hors ligne" } diff --git a/translations/ga.json b/translations/ga.json index da9c70605..91f0b3b18 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "RABHADH: seans go bhfuil an cuntas seo ag cur bac ort", "Nicknames of memorial accounts (one per line)": "Leasainmneacha na gcuntas cuimhneacháin (ceann in aghaidh na líne)", "Memorials": "Cuimhneacháin", - "places": "áiteanna" + "places": "áiteanna", + "offline": "as líne" } diff --git a/translations/he.json b/translations/he.json index 42d59d3ea..9c36e51a3 100644 --- a/translations/he.json +++ b/translations/he.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "אזהרה: ייתכן שחשבון זה חוסם אותך", "Nicknames of memorial accounts (one per line)": "כינויים של חשבונות זיכרון (אחד בכל שורה)", "Memorials": "אנדרטאות", - "places": "מקומות" + "places": "מקומות", + "offline": "במצב לא מקוון" } diff --git a/translations/hi.json b/translations/hi.json index c39b3ae3c..f7db24eee 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "चेतावनी: यह खाता आपको ब्लॉक कर सकता है", "Nicknames of memorial accounts (one per line)": "स्मारक खातों के उपनाम (प्रति पंक्ति एक)", "Memorials": "इतिवृत्त", - "places": "स्थानों" + "places": "स्थानों", + "offline": "ऑफलाइन" } diff --git a/translations/it.json b/translations/it.json index 3dd607c1f..988db5783 100644 --- a/translations/it.json +++ b/translations/it.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ATTENZIONE: questo account potrebbe bloccarti", "Nicknames of memorial accounts (one per line)": "Soprannomi degli account commemorativi (uno per riga)", "Memorials": "Memoriali", - "places": "luoghi" + "places": "luoghi", + "offline": "disconnessa" } diff --git a/translations/ja.json b/translations/ja.json index 29c11f71d..9edbba3e7 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "警告: このアカウントはあなたをブロックしている可能性があります", "Nicknames of memorial accounts (one per line)": "追悼アカウントのニックネーム(1行に1つ)", "Memorials": "記念碑", - "places": "場所" + "places": "場所", + "offline": "オフライン" } diff --git a/translations/ko.json b/translations/ko.json index f1dd6159b..ee62608e0 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "경고: 이 계정이 귀하를 차단하고 있을 수 있습니다.", "Nicknames of memorial accounts (one per line)": "추모 계정의 닉네임(한 줄에 하나씩)", "Memorials": "기록", - "places": "장소" + "places": "장소", + "offline": "오프라인" } diff --git a/translations/ku.json b/translations/ku.json index 0290b1c21..500e6b8c5 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "HIŞYARÎ: Dibe ku ev hesab we asteng bike", "Nicknames of memorial accounts (one per line)": "Nasnavên hesabên bîranînê (yek ji rêzê)", "Memorials": "Memorials", - "places": "cihên" + "places": "cihên", + "offline": "offline" } diff --git a/translations/nl.json b/translations/nl.json index 38dbb2b38..5fd9e231b 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "WAARSCHUWING: dit account blokkeert u mogelijk", "Nicknames of memorial accounts (one per line)": "Bijnamen van herdenkingsverslagen (één per regel)", "Memorials": "Gedenktekens", - "places": "plaatsen" + "places": "plaatsen", + "offline": "offline" } diff --git a/translations/oc.json b/translations/oc.json index 08974d865..64675a02d 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -633,5 +633,6 @@ "FollowAccountWarning": "WARNING: this account may be blocking you", "Nicknames of memorial accounts (one per line)": "Nicknames of memorial accounts (one per line)", "Memorials": "Memorials", - "places": "places" + "places": "places", + "offline": "offline" } diff --git a/translations/pl.json b/translations/pl.json index c0b27fb0b..8ec58b8a2 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "OSTRZEŻENIE: to konto może Cię blokować", "Nicknames of memorial accounts (one per line)": "Pseudonimy kont pamięci (po jednym w wierszu)", "Memorials": "Pamiętnik", - "places": "miejsca" + "places": "miejsca", + "offline": "nieaktywny" } diff --git a/translations/pt.json b/translations/pt.json index af4637603..9fd631029 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "AVISO: esta conta pode estar bloqueando você", "Nicknames of memorial accounts (one per line)": "Apelidos de contas memoriais (um por linha)", "Memorials": "Memoriais", - "places": "lugares" + "places": "lugares", + "offline": "desligada" } diff --git a/translations/ru.json b/translations/ru.json index 925173dcc..bc71a2076 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ВНИМАНИЕ: этот аккаунт может вас заблокировать", "Nicknames of memorial accounts (one per line)": "Никнеймы мемориальных аккаунтов (по одному в строке)", "Memorials": "Мемориалы", - "places": "места" + "places": "места", + "offline": "не в сети" } diff --git a/translations/sw.json b/translations/sw.json index cb54ea1b8..c2971c823 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ONYO: akaunti hii inaweza kuwa inakuzuia", "Nicknames of memorial accounts (one per line)": "Majina ya utani ya akaunti za ukumbusho (moja kwa kila mstari)", "Memorials": "Makumbusho", - "places": "maeneo" + "places": "maeneo", + "offline": "nje ya mtandao" } diff --git a/translations/tr.json b/translations/tr.json index 3f083ad7c..6d2bab9f2 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "DİKKAT: Bu hesap sizi engelliyor olabilir", "Nicknames of memorial accounts (one per line)": "Anma hesaplarının takma adları (her satıra bir tane)", "Memorials": "Anıtlar", - "places": "yer" + "places": "yer", + "offline": "çevrimdışı" } diff --git a/translations/uk.json b/translations/uk.json index 57e2a61f5..f5d7d50a6 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "УВАГА: цей обліковий запис може блокувати вас", "Nicknames of memorial accounts (one per line)": "Ніки меморіалів (по одному в рядку)", "Memorials": "Меморіали", - "places": "місць" + "places": "місць", + "offline": "офлайн" } diff --git a/translations/yi.json b/translations/yi.json index 1c8a706ee..c2c08f5b3 100644 --- a/translations/yi.json +++ b/translations/yi.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "ווארענונג: דער חשבון קען בלאַקינג איר", "Nicknames of memorial accounts (one per line)": "ניקניימז פון דענקמאָל אַקאַונץ (איינער פּער שורה)", "Memorials": "מעמאָריאַלן", - "places": "ערטער" + "places": "ערטער", + "offline": "אָפפלינע" } diff --git a/translations/zh.json b/translations/zh.json index 418f71774..0ce23b3b5 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -637,5 +637,6 @@ "FollowAccountWarning": "警告:此帐户可能会阻止您", "Nicknames of memorial accounts (one per line)": "纪念帐户昵称(每行一个)", "Memorials": "纪念馆", - "places": "地方" + "places": "地方", + "offline": "离线" } diff --git a/webapp_profile.py b/webapp_profile.py index 9ed37317a..1fe7a782a 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -844,7 +844,8 @@ def html_profile(signing_priv_key_pem: str, timezone: str, bold_reading: bool, buy_sites: {}, actor_proxied: str, - max_shares_on_profile: int) -> str: + max_shares_on_profile: int, + sites_unavailable: []) -> str: """Show the profile page as html """ show_moved_accounts = False @@ -1394,7 +1395,8 @@ def html_profile(signing_priv_key_pem: str, users_path, page_number, max_items_per_page, dormant_months, debug, - signing_priv_key_pem) + signing_priv_key_pem, + sites_unavailable) if show_moved_accounts and selected == 'moved': profile_str += \ _html_profile_following(translate, base_dir, http_prefix, @@ -1407,7 +1409,8 @@ def html_profile(signing_priv_key_pem: str, users_path, page_number, max_items_per_page, dormant_months, debug, - signing_priv_key_pem) + signing_priv_key_pem, + sites_unavailable) if selected == 'followers': profile_str += \ _html_profile_following(translate, base_dir, http_prefix, @@ -1418,7 +1421,7 @@ def html_profile(signing_priv_key_pem: str, project_version, ["block"], selected, users_path, page_number, max_items_per_page, dormant_months, debug, - signing_priv_key_pem) + signing_priv_key_pem, sites_unavailable) if authorized and selected == 'inactive': profile_str += \ _html_profile_following(translate, base_dir, http_prefix, @@ -1429,7 +1432,7 @@ def html_profile(signing_priv_key_pem: str, project_version, ["block"], selected, users_path, page_number, max_items_per_page, dormant_months, debug, - signing_priv_key_pem) + signing_priv_key_pem, sites_unavailable) if not is_group: if selected == 'roles': profile_str += \ @@ -1560,7 +1563,8 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str, page_number: int, max_items_per_page: int, dormant_months: int, debug: bool, - signing_priv_key_pem: str) -> str: + signing_priv_key_pem: str, + sites_unavailable: []) -> str: """Shows following on the profile screen """ profile_str = '' @@ -1582,10 +1586,18 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str, for following_actor in following_json['orderedItems']: # is this a dormant followed account? dormant = False - if authorized and feed_name == 'following': - dormant = \ - is_dormant(base_dir, nickname, domain, following_actor, - dormant_months) + offline = False + + following_domain, _ = get_domain_from_actor(following_actor) + if authorized: + if following_domain in sites_unavailable: + dormant = True + offline = True + else: + if feed_name == 'following': + dormant = \ + is_dormant(base_dir, nickname, domain, + following_actor, dormant_months) profile_str += \ _individual_follow_as_html(signing_priv_key_pem, @@ -1593,7 +1605,8 @@ def _html_profile_following(translate: {}, base_dir: str, http_prefix: str, cached_webfingers, person_cache, domain, following_actor, authorized, nickname, - http_prefix, project_version, dormant, + http_prefix, project_version, + dormant, offline, debug, buttons) if authorized and max_items_per_page and page_number: @@ -3104,6 +3117,7 @@ def _individual_follow_as_html(signing_priv_key_pem: str, http_prefix: str, project_version: str, dormant: bool, + offline: bool, debug: bool, buttons=[]) -> str: """An individual follow entry on the profile screen @@ -3156,6 +3170,8 @@ def _individual_follow_as_html(signing_priv_key_pem: str, if dormant: title_str += ' 💤' + if offline: + title_str += ' [' + translate['offline'].upper() + ']' buttons_str = '' if authorized: