Show other accounts on person options

merge-requests/9/merge
Bob Mottram 2021-01-22 20:35:14 +00:00
parent 4489cf143a
commit 67e5cb990a
17 changed files with 54 additions and 17 deletions

View File

@ -5359,6 +5359,7 @@ class PubServer(BaseHTTPRequestHandler):
ssbAddress = None ssbAddress = None
emailAddress = None emailAddress = None
lockedAccount = False lockedAccount = False
alsoKnownAs = None
movedTo = '' movedTo = ''
actorJson = getPersonFromCache(baseDir, actorJson = getPersonFromCache(baseDir,
optionsActor, optionsActor,
@ -5379,6 +5380,8 @@ class PubServer(BaseHTTPRequestHandler):
emailAddress = getEmailAddress(actorJson) emailAddress = getEmailAddress(actorJson)
PGPpubKey = getPGPpubKey(actorJson) PGPpubKey = getPGPpubKey(actorJson)
PGPfingerprint = getPGPfingerprint(actorJson) PGPfingerprint = getPGPfingerprint(actorJson)
if actorJson.get('alsoKnownAs'):
alsoKnownAs = actorJson['alsoKnownAs']
msg = htmlPersonOptions(self.server.defaultTimeline, msg = htmlPersonOptions(self.server.defaultTimeline,
self.server.cssCache, self.server.cssCache,
self.server.translate, self.server.translate,
@ -5398,7 +5401,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.dormantMonths, self.server.dormantMonths,
backToPath, backToPath,
lockedAccount, lockedAccount,
movedTo).encode('utf-8') movedTo, alsoKnownAs).encode('utf-8')
msglen = len(msg) msglen = len(msg)
self._set_headers('text/html', msglen, self._set_headers('text/html', msglen,
cookie, callingDomain) cookie, callingDomain)

View File

@ -359,5 +359,6 @@
"Word frequencies": "ترددات الكلمات", "Word frequencies": "ترددات الكلمات",
"New account": "حساب جديد", "New account": "حساب جديد",
"Moved to new account address": "انتقل إلى عنوان الحساب الجديد", "Moved to new account address": "انتقل إلى عنوان الحساب الجديد",
"Yet another Epicyon Instance": "مثال آخر Epicyon" "Yet another Epicyon Instance": "مثال آخر Epicyon",
"Other accounts": "حسابات أخرى"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Freqüències de paraules", "Word frequencies": "Freqüències de paraules",
"New account": "Compte nou", "New account": "Compte nou",
"Moved to new account address": "S'ha mogut a l'adreça del compte nova", "Moved to new account address": "S'ha mogut a l'adreça del compte nova",
"Yet another Epicyon Instance": "Encara una altra instància Epicyon" "Yet another Epicyon Instance": "Encara una altra instància Epicyon",
"Other accounts": "Altres comptes"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Amleddau geiriau", "Word frequencies": "Amleddau geiriau",
"New account": "Cyfrif newydd", "New account": "Cyfrif newydd",
"Moved to new account address": "Wedi'i symud i gyfeiriad cyfrif newydd", "Moved to new account address": "Wedi'i symud i gyfeiriad cyfrif newydd",
"Yet another Epicyon Instance": "Digwyddiad Epicyon arall" "Yet another Epicyon Instance": "Digwyddiad Epicyon arall",
"Other accounts": "Cyfrifon eraill"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Worthäufigkeiten", "Word frequencies": "Worthäufigkeiten",
"New account": "Neues Konto", "New account": "Neues Konto",
"Moved to new account address": "An neue Kontoadresse verschoben", "Moved to new account address": "An neue Kontoadresse verschoben",
"Yet another Epicyon Instance": "Noch eine Epicyon-Instanz" "Yet another Epicyon Instance": "Noch eine Epicyon-Instanz",
"Other accounts": "Andere Konten"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Word frequencies", "Word frequencies": "Word frequencies",
"New account": "New account", "New account": "New account",
"Moved to new account address": "Moved to new account address", "Moved to new account address": "Moved to new account address",
"Yet another Epicyon Instance": "Yet another Epicyon Instance" "Yet another Epicyon Instance": "Yet another Epicyon Instance",
"Other accounts": "Other accounts"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Frecuencias de palabras", "Word frequencies": "Frecuencias de palabras",
"New account": "Nueva cuenta", "New account": "Nueva cuenta",
"Moved to new account address": "Movido a la nueva dirección de la cuenta", "Moved to new account address": "Movido a la nueva dirección de la cuenta",
"Yet another Epicyon Instance": "Otra instancia más de Epicyon" "Yet another Epicyon Instance": "Otra instancia más de Epicyon",
"Other accounts": "Otras cuentas"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Fréquences des mots", "Word frequencies": "Fréquences des mots",
"New account": "Nouveau compte", "New account": "Nouveau compte",
"Moved to new account address": "Déplacé vers une nouvelle adresse de compte", "Moved to new account address": "Déplacé vers une nouvelle adresse de compte",
"Yet another Epicyon Instance": "Encore une autre instance Epicyon" "Yet another Epicyon Instance": "Encore une autre instance Epicyon",
"Other accounts": "Autres comptes"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Minicíochtaí focal", "Word frequencies": "Minicíochtaí focal",
"New account": "Cuntas nua", "New account": "Cuntas nua",
"Moved to new account address": "Ar athraíodh a ionad go seoladh cuntas nua", "Moved to new account address": "Ar athraíodh a ionad go seoladh cuntas nua",
"Yet another Epicyon Instance": "Institiúid Epicyon eile fós" "Yet another Epicyon Instance": "Institiúid Epicyon eile fós",
"Other accounts": "Cuntais eile"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "शब्द आवृत्तियों", "Word frequencies": "शब्द आवृत्तियों",
"New account": "नया खाता", "New account": "नया खाता",
"Moved to new account address": "नए खाते के पते पर ले जाया गया", "Moved to new account address": "नए खाते के पते पर ले जाया गया",
"Yet another Epicyon Instance": "फिर भी एक और एपिकॉन उदाहरण" "Yet another Epicyon Instance": "फिर भी एक और एपिकॉन उदाहरण",
"Other accounts": "अन्य खाते"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Frequenze di parole", "Word frequencies": "Frequenze di parole",
"New account": "Nuovo account", "New account": "Nuovo account",
"Moved to new account address": "Spostato al nuovo indirizzo dell'account", "Moved to new account address": "Spostato al nuovo indirizzo dell'account",
"Yet another Epicyon Instance": "Ancora un'altra istanza di Epicyon" "Yet another Epicyon Instance": "Ancora un'altra istanza di Epicyon",
"Other accounts": "Altri account"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "単語の頻度", "Word frequencies": "単語の頻度",
"New account": "新しいアカウント", "New account": "新しいアカウント",
"Moved to new account address": "新しいアカウントアドレスに移動しました", "Moved to new account address": "新しいアカウントアドレスに移動しました",
"Yet another Epicyon Instance": "さらに別のエピキオンインスタンス" "Yet another Epicyon Instance": "さらに別のエピキオンインスタンス",
"Other accounts": "その他のアカウント"
} }

View File

@ -355,5 +355,6 @@
"Word frequencies": "Word frequencies", "Word frequencies": "Word frequencies",
"New account": "New account", "New account": "New account",
"Moved to new account address": "Moved to new account address", "Moved to new account address": "Moved to new account address",
"Yet another Epicyon Instance": "Yet another Epicyon Instance" "Yet another Epicyon Instance": "Yet another Epicyon Instance",
"Other accounts": "Other accounts"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Frequências de palavras", "Word frequencies": "Frequências de palavras",
"New account": "Nova conta", "New account": "Nova conta",
"Moved to new account address": "Movido para o novo endereço da conta", "Moved to new account address": "Movido para o novo endereço da conta",
"Yet another Epicyon Instance": "Mais uma instância do Epicyon" "Yet another Epicyon Instance": "Mais uma instância do Epicyon",
"Other accounts": "Outras contas"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "Частоты слов", "Word frequencies": "Частоты слов",
"New account": "Новый аккаунт", "New account": "Новый аккаунт",
"Moved to new account address": "Перемещен на новый адрес учетной записи", "Moved to new account address": "Перемещен на новый адрес учетной записи",
"Yet another Epicyon Instance": "Еще один экземпляр Эпикиона" "Yet another Epicyon Instance": "Еще один экземпляр Эпикиона",
"Other accounts": "Другие аккаунты"
} }

View File

@ -359,5 +359,6 @@
"Word frequencies": "词频", "Word frequencies": "词频",
"New account": "新账户", "New account": "新账户",
"Moved to new account address": "移至新帐户地址", "Moved to new account address": "移至新帐户地址",
"Yet another Epicyon Instance": "另一个Epicyon实例" "Yet another Epicyon Instance": "另一个Epicyon实例",
"Other accounts": "其他账户"
} }

View File

@ -48,7 +48,8 @@ def htmlPersonOptions(defaultTimeline: str,
dormantMonths: int, dormantMonths: int,
backToPath: str, backToPath: str,
lockedAccount: bool, lockedAccount: bool,
movedTo: str) -> str: movedTo: str,
alsoKnownAs: []) -> str:
"""Show options for a person: view/follow/block/report """Show options for a person: view/follow/block/report
""" """
optionsDomain, optionsPort = getDomainFromActor(optionsActor) optionsDomain, optionsPort = getDomainFromActor(optionsActor)
@ -143,6 +144,24 @@ def htmlPersonOptions(defaultTimeline: str,
' <p class="optionsText">' + \ ' <p class="optionsText">' + \
translate['New account'] + \ translate['New account'] + \
': <a href="' + movedTo + '">@' + newHandle + '</a></p>\n' ': <a href="' + movedTo + '">@' + newHandle + '</a></p>\n'
elif alsoKnownAs:
optionsStr += \
' <p class="optionsText">' + \
translate['Other accounts'] + ': '
if isinstance(alsoKnownAs, list):
ctr = 0
for altActor in alsoKnownAs:
if ctr > 0:
optionsStr += ' '
ctr += 1
altDomain, altPort = getDomainFromActor(altActor)
optionsStr += \
'<a href="' + altActor + '">' + altDomain + '</a>'
elif isinstance(alsoKnownAs, str):
altDomain, altPort = getDomainFromActor(alsoKnownAs)
optionsStr += '<a href="' + alsoKnownAs + '">' + altDomain + '</a>'
optionsStr += '</p>\n'
if emailAddress: if emailAddress:
optionsStr += \ optionsStr += \
'<p class="imText">' + translate['Email'] + \ '<p class="imText">' + translate['Email'] + \