Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon

main
Bob Mottram 2021-05-08 20:06:51 +01:00
commit 2bc0854340
18 changed files with 70 additions and 24 deletions

View File

@ -35,6 +35,7 @@ from auth import storeBasicCredentials
from auth import removePassword from auth import removePassword
from roles import setRole from roles import setRole
from media import removeMetaData from media import removeMetaData
from utils import getStatusNumber
from utils import getFullDomain from utils import getFullDomain
from utils import validNickname from utils import validNickname
from utils import loadJson from utils import loadJson
@ -272,12 +273,14 @@ def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
personId + '/avatar' + \ personId + '/avatar' + \
str(randint(10000000000000, 99999999999999)) + '.png' # nosec str(randint(10000000000000, 99999999999999)) + '.png' # nosec
statusNumber, published = getStatusNumber()
newPerson = { newPerson = {
'@context': [ '@context': [
'https://www.w3.org/ns/activitystreams', 'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1', 'https://w3id.org/security/v1',
getDefaultPersonContext() getDefaultPersonContext()
], ],
'published': published,
'alsoKnownAs': [], 'alsoKnownAs': [],
'attachment': [], 'attachment': [],
'devices': personId + '/collections/devices', 'devices': personId + '/collections/devices',
@ -563,11 +566,17 @@ def personUpgradeActor(baseDir: str, personJson: {},
if not personJson: if not personJson:
personJson = loadJson(filename) personJson = loadJson(filename)
if updateActor:
# add a speaker endpoint # add a speaker endpoint
if not personJson.get('tts'): if not personJson.get('tts'):
personJson['tts'] = personJson['id'] + '/speaker' personJson['tts'] = personJson['id'] + '/speaker'
updateActor = True
if not personJson.get('published'):
statusNumber, published = getStatusNumber()
personJson['published'] = published
updateActor = True
if updateActor:
saveJson(personJson, filename) saveJson(personJson, filename)
# also update the actor within the cache # also update the actor within the cache

View File

@ -439,5 +439,6 @@
"enterNotes": "أدخل الملاحظات", "enterNotes": "أدخل الملاحظات",
"These access keys may be used": "قد يتم استخدام مفاتيح الوصول هذه، عادة مع مفتاح ALT + SHIFT + مفتاح ALT +", "These access keys may be used": "قد يتم استخدام مفاتيح الوصول هذه، عادة مع مفتاح ALT + SHIFT + مفتاح ALT +",
"Show numbers of accounts within instance metadata": "إظهار عدد الحسابات داخل البيانات الوصفية للمثيلات", "Show numbers of accounts within instance metadata": "إظهار عدد الحسابات داخل البيانات الوصفية للمثيلات",
"Show version number within instance metadata": "إظهار رقم الإصدار داخل البيانات الوصفية للمثيل" "Show version number within instance metadata": "إظهار رقم الإصدار داخل البيانات الوصفية للمثيل",
"Joined": "تاريخ الانضمام"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Introduïu notes", "enterNotes": "Introduïu notes",
"These access keys may be used": "Es poden utilitzar aquestes tecles d'accés, típicament amb Alt + Maj + tecla o Alt + clau", "These access keys may be used": "Es poden utilitzar aquestes tecles d'accés, típicament amb Alt + Maj + tecla o Alt + clau",
"Show numbers of accounts within instance metadata": "Mostra el nombre de comptes a les metadades de la instància", "Show numbers of accounts within instance metadata": "Mostra el nombre de comptes a les metadades de la instància",
"Show version number within instance metadata": "Mostra el número de versió a les metadades de la instància" "Show version number within instance metadata": "Mostra el número de versió a les metadades de la instància",
"Joined": "Data d'unió"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Rhowch nodiadau", "enterNotes": "Rhowch nodiadau",
"These access keys may be used": "Gellir defnyddio'r allweddi mynediad hyn, fel arfer gyda ALT + Shift + Allwedd Allwedd neu ALT +", "These access keys may be used": "Gellir defnyddio'r allweddi mynediad hyn, fel arfer gyda ALT + Shift + Allwedd Allwedd neu ALT +",
"Show numbers of accounts within instance metadata": "Dangos nifer y cyfrifon o fewn metadata", "Show numbers of accounts within instance metadata": "Dangos nifer y cyfrifon o fewn metadata",
"Show version number within instance metadata": "Dangos rhif y fersiwn o fewn metadata" "Show version number within instance metadata": "Dangos rhif y fersiwn o fewn metadata",
"Joined": "Dyddiad ymuno"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Notizen eingeben", "enterNotes": "Notizen eingeben",
"These access keys may be used": "Diese Zugriffstasten können verwendet werden, typischerweise mit ALT + SHIFT + -Taste oder ALT + -Taste", "These access keys may be used": "Diese Zugriffstasten können verwendet werden, typischerweise mit ALT + SHIFT + -Taste oder ALT + -Taste",
"Show numbers of accounts within instance metadata": "Anzahl der Konten in Instanzmetadaten anzeigen", "Show numbers of accounts within instance metadata": "Anzahl der Konten in Instanzmetadaten anzeigen",
"Show version number within instance metadata": "Versionsnummer in Instanzmetadaten anzeigen" "Show version number within instance metadata": "Versionsnummer in Instanzmetadaten anzeigen",
"Joined": "Verbundenes Datum"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Enter notes", "enterNotes": "Enter notes",
"These access keys may be used": "These access keys may be used, typically with ALT + SHIFT + key or ALT + key", "These access keys may be used": "These access keys may be used, typically with ALT + SHIFT + key or ALT + key",
"Show numbers of accounts within instance metadata": "Show numbers of accounts within instance metadata", "Show numbers of accounts within instance metadata": "Show numbers of accounts within instance metadata",
"Show version number within instance metadata": "Show version number within instance metadata" "Show version number within instance metadata": "Show version number within instance metadata",
"Joined": "Joined"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Ingresar notas", "enterNotes": "Ingresar notas",
"These access keys may be used": "Se pueden usar estas teclas de acceso, típicamente con teclas ALT + MAYÚS + teclas o ALT +", "These access keys may be used": "Se pueden usar estas teclas de acceso, típicamente con teclas ALT + MAYÚS + teclas o ALT +",
"Show numbers of accounts within instance metadata": "Muestra el número de cuentas dentro de los metadatos de la instancia.", "Show numbers of accounts within instance metadata": "Muestra el número de cuentas dentro de los metadatos de la instancia.",
"Show version number within instance metadata": "Mostrar el número de versión dentro de los metadatos de la instancia" "Show version number within instance metadata": "Mostrar el número de versión dentro de los metadatos de la instancia",
"Joined": "Fecha unida"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Faire entrer des notes", "enterNotes": "Faire entrer des notes",
"These access keys may be used": "Ces touches d'accès peuvent être utilisées typiquement avec une touche Alt + Maj + ou Alt +", "These access keys may be used": "Ces touches d'accès peuvent être utilisées typiquement avec une touche Alt + Maj + ou Alt +",
"Show numbers of accounts within instance metadata": "Afficher le nombre de comptes dans les métadonnées de l'instance", "Show numbers of accounts within instance metadata": "Afficher le nombre de comptes dans les métadonnées de l'instance",
"Show version number within instance metadata": "Afficher le numéro de version dans les métadonnées de l'instance" "Show version number within instance metadata": "Afficher le numéro de version dans les métadonnées de l'instance",
"Joined": "Joint"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Cuir nótaí isteach", "enterNotes": "Cuir nótaí isteach",
"These access keys may be used": "Is féidir na heochracha rochtana seo a úsáid, de ghnáth le Alt + Shift + Eochair nó Alt + Eochair", "These access keys may be used": "Is féidir na heochracha rochtana seo a úsáid, de ghnáth le Alt + Shift + Eochair nó Alt + Eochair",
"Show numbers of accounts within instance metadata": "Taispeáin líon na gcuntas laistigh de mheiteashonraí", "Show numbers of accounts within instance metadata": "Taispeáin líon na gcuntas laistigh de mheiteashonraí",
"Show version number within instance metadata": "Taispeáin uimhir an leagain laistigh de mheiteashonraí" "Show version number within instance metadata": "Taispeáin uimhir an leagain laistigh de mheiteashonraí",
"Joined": "Dáta comhcheangailte"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "नोट्स दर्ज करें", "enterNotes": "नोट्स दर्ज करें",
"These access keys may be used": "इन एक्सेस कुंजियों का उपयोग किया जा सकता है, आमतौर पर Alt + Shift + कुंजी या Alt + कुंजी के साथ", "These access keys may be used": "इन एक्सेस कुंजियों का उपयोग किया जा सकता है, आमतौर पर Alt + Shift + कुंजी या Alt + कुंजी के साथ",
"Show numbers of accounts within instance metadata": "उदाहरण मेटाडेटा के भीतर खातों की संख्या दिखाएं", "Show numbers of accounts within instance metadata": "उदाहरण मेटाडेटा के भीतर खातों की संख्या दिखाएं",
"Show version number within instance metadata": "उदाहरण मेटाडेटा के भीतर संस्करण संख्या दिखाएं" "Show version number within instance metadata": "उदाहरण मेटाडेटा के भीतर संस्करण संख्या दिखाएं",
"Joined": "दिनांक"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Inserisci le note", "enterNotes": "Inserisci le note",
"These access keys may be used": "Questi tasti di accesso possono essere utilizzati, in genere con tasto ALT + MAIUSC + o ALT + Key", "These access keys may be used": "Questi tasti di accesso possono essere utilizzati, in genere con tasto ALT + MAIUSC + o ALT + Key",
"Show numbers of accounts within instance metadata": "Mostra il numero di account all'interno dei metadati dell'istanza", "Show numbers of accounts within instance metadata": "Mostra il numero di account all'interno dei metadati dell'istanza",
"Show version number within instance metadata": "Mostra il numero di versione nei metadati dell'istanza" "Show version number within instance metadata": "Mostra il numero di versione nei metadati dell'istanza",
"Joined": "Unito"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "ノートを入力してください", "enterNotes": "ノートを入力してください",
"These access keys may be used": "これらのアクセスキーは、通常はAlt + Shift +キーまたはAlt +キーを使用して使用できます。", "These access keys may be used": "これらのアクセスキーは、通常はAlt + Shift +キーまたはAlt +キーを使用して使用できます。",
"Show numbers of accounts within instance metadata": "インスタンスメタデータ内のアカウント数を表示する", "Show numbers of accounts within instance metadata": "インスタンスメタデータ内のアカウント数を表示する",
"Show version number within instance metadata": "インスタンスメタデータ内にバージョン番号を表示する" "Show version number within instance metadata": "インスタンスメタデータ内にバージョン番号を表示する",
"Joined": "参加日"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Nîşan binivîse", "enterNotes": "Nîşan binivîse",
"These access keys may be used": "Dibe ku ev keysên gihîştinê bikar bînin, bi gelemperî bi alt + shift + key an alt + key", "These access keys may be used": "Dibe ku ev keysên gihîştinê bikar bînin, bi gelemperî bi alt + shift + key an alt + key",
"Show numbers of accounts within instance metadata": "Di nav metadata mînakê de hejmarên hesaban nîşan bidin", "Show numbers of accounts within instance metadata": "Di nav metadata mînakê de hejmarên hesaban nîşan bidin",
"Show version number within instance metadata": "Di nav metadata mînakê de nimreya guhertoyê nîşan bide" "Show version number within instance metadata": "Di nav metadata mînakê de nimreya guhertoyê nîşan bide",
"Joined": "Beşdarbûna Dîrokê"
} }

View File

@ -435,5 +435,6 @@
"enterNotes": "Enter notes", "enterNotes": "Enter notes",
"These access keys may be used": "These access keys may be used, typically with ALT + SHIFT + key or ALT + key", "These access keys may be used": "These access keys may be used, typically with ALT + SHIFT + key or ALT + key",
"Show numbers of accounts within instance metadata": "Show numbers of accounts within instance metadata", "Show numbers of accounts within instance metadata": "Show numbers of accounts within instance metadata",
"Show version number within instance metadata": "Show version number within instance metadata" "Show version number within instance metadata": "Show version number within instance metadata",
"Joined": "Joined"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Digite notas", "enterNotes": "Digite notas",
"These access keys may be used": "Essas teclas de acesso podem ser usadas, normalmente com tecla Alt + Shift + Key ou Alt +", "These access keys may be used": "Essas teclas de acesso podem ser usadas, normalmente com tecla Alt + Shift + Key ou Alt +",
"Show numbers of accounts within instance metadata": "Mostra o número de contas nos metadados da instância", "Show numbers of accounts within instance metadata": "Mostra o número de contas nos metadados da instância",
"Show version number within instance metadata": "Mostrar o número da versão nos metadados da instância" "Show version number within instance metadata": "Mostrar o número da versão nos metadados da instância",
"Joined": "Data juntada"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "Введите ноты", "enterNotes": "Введите ноты",
"These access keys may be used": "Эти ключевые ключи доступа могут быть использованы, обычно с ALT + Shift + Key или Alt + Key", "These access keys may be used": "Эти ключевые ключи доступа могут быть использованы, обычно с ALT + Shift + Key или Alt + Key",
"Show numbers of accounts within instance metadata": "Показать количество учетных записей в метаданных экземпляра", "Show numbers of accounts within instance metadata": "Показать количество учетных записей в метаданных экземпляра",
"Show version number within instance metadata": "Показать номер версии в метаданных экземпляра" "Show version number within instance metadata": "Показать номер версии в метаданных экземпляра",
"Joined": "Присоединенная дата"
} }

View File

@ -439,5 +439,6 @@
"enterNotes": "输入笔记", "enterNotes": "输入笔记",
"These access keys may be used": "可以使用这些访问密钥通常使用Alt + Shift +键或ALT +键", "These access keys may be used": "可以使用这些访问密钥通常使用Alt + Shift +键或ALT +键",
"Show numbers of accounts within instance metadata": "显示实例元数据中的帐户数", "Show numbers of accounts within instance metadata": "显示实例元数据中的帐户数",
"Show version number within instance metadata": "在实例元数据中显示版本号" "Show version number within instance metadata": "在实例元数据中显示版本号",
"Joined": "加入日期"
} }

View File

@ -246,6 +246,11 @@ def htmlProfileAfterSearch(cssCache: {},
if profileJson.get('alsoKnownAs'): if profileJson.get('alsoKnownAs'):
alsoKnownAs = profileJson['alsoKnownAs'] alsoKnownAs = profileJson['alsoKnownAs']
joinedDate = None
if profileJson.get('published'):
if 'T' in profileJson['published']:
joinedDate = profileJson['published']
profileStr = \ profileStr = \
_getProfileHeaderAfterSearch(baseDir, _getProfileHeaderAfterSearch(baseDir,
nickname, defaultTimeline, nickname, defaultTimeline,
@ -256,7 +261,8 @@ def htmlProfileAfterSearch(cssCache: {},
profileDescriptionShort, profileDescriptionShort,
avatarUrl, imageUrl, avatarUrl, imageUrl,
movedTo, profileJson['id'], movedTo, profileJson['id'],
alsoKnownAs, accessKeys) alsoKnownAs, accessKeys,
joinedDate)
domainFull = getFullDomain(domain, port) domainFull = getFullDomain(domain, port)
@ -335,7 +341,8 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
theme: str, movedTo: str, theme: str, movedTo: str,
alsoKnownAs: [], alsoKnownAs: [],
pinnedContent: str, pinnedContent: str,
accessKeys: {}) -> str: accessKeys: {},
joinedDate: str) -> str:
"""The header of the profile screen, containing background """The header of the profile screen, containing background
image and avatar image and avatar
""" """
@ -357,6 +364,10 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
htmlStr += ' <h1>' + displayName + '</h1>\n' htmlStr += ' <h1>' + displayName + '</h1>\n'
htmlStr += \ htmlStr += \
' <p><b>@' + nickname + '@' + domainFull + '</b><br>\n' ' <p><b>@' + nickname + '@' + domainFull + '</b><br>\n'
if joinedDate:
htmlStr += \
' <p>' + translate['Joined'] + ' ' + \
joinedDate.split('T')[0] + '<br>\n'
if movedTo: if movedTo:
newNickname = getNicknameFromActor(movedTo) newNickname = getNicknameFromActor(movedTo)
newDomain, newPort = getDomainFromActor(movedTo) newDomain, newPort = getDomainFromActor(movedTo)
@ -417,7 +428,8 @@ def _getProfileHeaderAfterSearch(baseDir: str,
avatarUrl: str, imageUrl: str, avatarUrl: str, imageUrl: str,
movedTo: str, actor: str, movedTo: str, actor: str,
alsoKnownAs: [], alsoKnownAs: [],
accessKeys: {}) -> str: accessKeys: {},
joinedDate: str) -> str:
"""The header of a searched for handle, containing background """The header of a searched for handle, containing background
image and avatar image and avatar
""" """
@ -440,6 +452,9 @@ def _getProfileHeaderAfterSearch(baseDir: str,
htmlStr += ' <h1>' + displayName + '</h1>\n' htmlStr += ' <h1>' + displayName + '</h1>\n'
htmlStr += \ htmlStr += \
' <p><b>@' + searchNickname + '@' + searchDomainFull + '</b><br>\n' ' <p><b>@' + searchNickname + '@' + searchDomainFull + '</b><br>\n'
if joinedDate:
htmlStr += ' <p>' + translate['Joined'] + ' ' + \
joinedDate.split('T')[0] + '</p>\n'
if followsYou: if followsYou:
htmlStr += ' <p><b>' + translate['Follows you'] + '</b></p>\n' htmlStr += ' <p><b>' + translate['Follows you'] + '</b></p>\n'
if movedTo: if movedTo:
@ -711,6 +726,11 @@ def htmlProfile(rssIconAtTop: bool,
if profileJson.get('alsoKnownAs'): if profileJson.get('alsoKnownAs'):
alsoKnownAs = profileJson['alsoKnownAs'] alsoKnownAs = profileJson['alsoKnownAs']
joinedDate = None
if profileJson.get('published'):
if 'T' in profileJson['published']:
joinedDate = profileJson['published']
avatarUrl = profileJson['icon']['url'] avatarUrl = profileJson['icon']['url']
# get pinned post content # get pinned post content
@ -730,7 +750,8 @@ def htmlProfile(rssIconAtTop: bool,
profileDescriptionShort, profileDescriptionShort,
loginButton, avatarUrl, theme, loginButton, avatarUrl, theme,
movedTo, alsoKnownAs, movedTo, alsoKnownAs,
pinnedContent, accessKeys) pinnedContent, accessKeys,
joinedDate)
# keyboard navigation # keyboard navigation
userPathStr = '/users/' + nickname userPathStr = '/users/' + nickname